Using JSON with MongoDB?

前端 未结 4 401
南旧
南旧 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:27

    i don't know about java mongo driver, but in c# mongo driver has BsonSerializer class. You can use it like following code:

    var q = BsonSerializer.Deserialize("{ jsonValueName:jsonValue }"); 
    

    plz check mongo-java-driver, i thank it should contain the same facilities

    also look at bson4jackson

提交回复
热议问题