Details
-
Task
-
Resolution: Done
-
Major - P3
-
None
-
None
-
None
-
None
Description
I'm interested in getting the raw json from my queries:
I have the following simple code:
db = new Mongo().getDB("myDatabase");
DBCollection coll = db.getCollection("myCollection");
DBCursor cursor = coll.find();
And "String raw = cursor.next().toString();" will allow me to get the raw json for my query.
However getDB() is deprecated and as far as I can tell the new getDatabase() line of API calls convert the json results to java objects automatically.
My question is, how can I get to the raw json returned by a query using the getDatabase() line of API calls like I used to?
Thanks