Using JSON with MongoDB?

前端 未结 4 406
南旧
南旧 2020-12-13 15:18

My application uses JSON objects a lot (org.json.JSONArray and friends). What\'s the most efficient way to store these into Mongo DBObjects so they can be queried? BasicDBOb

4条回答
  •  误落风尘
    2020-12-13 15:26

    This works, and throws the question as to why the Mongo folks decided to have an Object return type instead of a DBObject: does anyone know?

    A good alternative, if you have a lot of JSON in your app, would be to use Jackson for the (de)serialization.

提交回复
热议问题