Solution: Using Logical Operators
We'll cover the following...
Query
db.orders.find({$and: [{ $or: [{ status: "Pending" }, { status: "Processing" }] },{ total: { $gt: 500 } }]}).sort({ orderDate: -1 }).limit(3)
The explanation of the query is given below:
Line 1: This begins a query (a read operation) that will search documents in
ordersmatching the filter object provided between the braces{ ... }.Line 2: ...