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
com.mongodb.util.JSON has a method to parse a JSON string into DBObject. The default JSONCallback will return a BasicDBObject or BasicDBList according to input string.
Object jsonObj = ...; //any of your org.json objects
Object o = com.mongodb.util.JSON.parse(jsonObj.toString());
DBObject dbObj = (DBObject) o;