Using the java MongoClient
library, how can I find a document in a collection and only return specific Objects
? I know this is possible for 1 Object
but not sure about multiple.
For 1 Object
:
DBCursor cursor = db.getCollection(collectionName).find(dbObject)
Possibly for 2 Objects
??:
DBCursor cursor = db.getCollection(collectionName).find(dbObject1, dbObject2, dbObject3)