MongoDB find and code example
Example 1: find with $or in mongobd
db.inventory.find( { $or: [ { quantity: { $lt: 20 } }, { price: 10 } ] } )
Example 2: and operation mongodb find
db.inventory.find( { $and: [ { price: { $ne: 1.99 } }, { price: { $exists: true } } ] } )
Example 3: and in mongodb
{ $and: [ <expression1>, <expression2>, ... ] }
Example 4: mongodb find multiple fields
{ <field1>: <value>, <field2>: <value> ... }