Solution: Using Logical Operators
We'll cover the following...
We'll cover the following...
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: This uses the
$andlogical operator. It takes an array of subfilters and requires all of them to be true for a document to match. In this query, there are two conditions inside the array; both must be satisfied.Line 3: This is the first element of the
$andarray: an$orcondition....