MongoDB Documentation, Release 3.0.4 Additional Examples and Methods 3.3.2 Query Documents Select All Documents in a Collection Specify Equality Condition Specify Conditions Using Query Operators 11 The db.collection.findOne() method also performs a read operation to return a single document. Internally, the db.collection.findOne() method is the db.collection.find() method with a limit of 1. Chapter 3. MongoDB CRUD Operations 96 A query document can use the query operators to specify conditions in a MongoDB query. The following example selects all documents in the inventory collection where the value of the type field is either ’food’ or ’snacks’ : db.inventory.find( { type: { $in: [ 'food', 'snacks' ] } } ) Although you can express this query using the $or operator, use the $in operator rather than the $or operator when performing equality checks on the same field. Refer to the http://docs.mongodb.org/manual/reference/operator/query document for the com- plete list of query operators. db.inventory.find( { type: "snacks" } ) The following example retrieves from the inventory collection all documents where the type field has the value snacks : To specify equality condition, use the query document { <field>: <value> } to select all documents that contain the <field> with the specified <value> . db.inventory.find() Not specifying a query document to the find() is equivalent to specifying an empty query document. Therefore the following operation is equivalent to the previous operation: db.inventory.find( {} ) An empty query document ( {} ) selects all documents in the collection: This tutorial provides examples of read operations using the db.collection.find() method in the mongo shell. In these examples, the retrieved documents contain all their fields. To restrict the fields to return in the retrieved documents, see Limit Fields to Return from a Query (page 107). In MongoDB, the db.collection.find() method retrieves documents from a collection. 11 The db.collection.find() method returns a cursor (page 64) to the retrieved documents. For more examples, see db.collection.insert() . The db.collection.update() method, the db.collection.findAndModify() , and the db.collection.save() method can also add new documents. See the individual reference pages for the methods for more information and examples.