//The basic syntax of find() method is as follows
db.COLLECTION_NAME.find() or db.mycol.find().pretty()
db.inventory.find( { status: "D" } )
db.inventory.find( { size: { h: 14, w: 21, uom: "cm" } } )
//Where Clause Equivalents
db.mycol.find({"by":"tutorials point"}).pretty() //=
db.mycol.find({"likes":{$lt:50}}).pretty() //<
db.mycol.find({"likes":{$lte:50}}).pretty() //<=
db.mycol.find({"likes":{$gt:50}}).pretty() //>
db.mycol.find({"likes":{$gte:50}}).pretty() //>=
db.mycol.find({"likes":{$ne:50}}).pretty() //!=
//AND
db.mycol.find({$and:[{"by":"tutorials point"},{"title": "MongoDB Overview"}]})
//OR
db.mycol.find({$or:[{"by":"tutorials point"},{"title": "MongoDB Overview"}]})
//BOTH
db.mycol.find({"likes": {$gt:10}, $or: [{"by": "tutorials point"},{"title": "MongoDB Overview"}]})
//projection, selecting keys
//you need to set a list of fields with value 1 or 0.
// 1 is used to show the field while 0 is used to hide the fields
//e.g.
// Docs:
// { "_id" : ObjectId(5983548781331adf45ec5), "title":"MongoDB Overview"}
// { "_id" : ObjectId(5983548781331adf45ec6), "title":"NoSQL Overview"}
// { "_id" : ObjectId(5983548781331adf45ec7), "title":"Tutorials Point Overview"}
db.mycol.find({},{"title":1,_id:0}) //excluding Id field
// Result:
// {"title":"MongoDB Overview"}
// {"title":"NoSQL Overview"}
// {"title":"Tutorials Point Overview"}
//Limit & Skip
//db.COLLECTION_NAME.find().limit(NUMBER)
db.mycol.find({},{"title":1,_id:0}).limit(2)
//db.COLLECTION_NAME.find().limit(NUMBER).skip(NUMBER)
//Following example will display only the second document.
db.mycol.find({},{"title":1,_id:0}).limit(1).skip(1)
//Sort
db.COLLECTION_NAME.find().sort({KEY:1})
db.mycol.find({},{"title":1,_id:0}).sort({"title":-1})