Specify AND Conditions Specify OR Conditions Specify AND as well as OR Conditions Embedded Documents Exact Match on the Embedded Document MongoDB Documentation, Release 3.0.4 A compound query can specify conditions for more than one field in the collection’s documents. Implicitly, a logical AND conjunction connects the clauses of a compound query so that the query selects the documents in the collection that match all the conditions. In the following example, the query document specifies an equality match on the field type and a less than ( $lt ) comparison match on the field price : This query selects all documents where the type field has the value ’food’ and the value of the price field is less than 9.95 . See comparison operators for other comparison operators. db.inventory.find( { type: 'food', price: { $lt: 9.95 } } ) Using the $or operator, you can specify a compound query that joins each clause with a logical OR conjunction so that the query selects the documents in the collection that match at least one condition. In the following example, the query document selects all documents in the collection where the field qty has a value greater than ( $gt ) 100 or the value of the price field is less than ( $lt ) 9.95 : db.inventory.find( { $or: [ { qty: { $gt: 100 } }, { price: { $lt: 9.95 } } ] } ) With additional clauses, you can specify precise conditions for matching documents. In the following example, the compound query document selects all documents in the collection where the value of the type field is ’food’ and either the qty has a value greater than ( $gt ) 100 or the value of the price field is less than ( $lt ) 9.95 : db.inventory.find( { type: 'food', $or: [ { qty: { $gt: 100 } }, { price: { $lt: 9.95 } } ] } ) When the field holds an embedded document, a query can either specify an exact match on the embedded document or specify a match by individual fields in the embedded document using the dot notation . To specify an equality match on the whole embedded document, use the query document { <field>: <value> } where <value> is the document to match. Equality matches on an embedded document require an exact match of the specified <value> , including the field order. 97 3.3. MongoDB CRUD Tutorials