Reputation: 135
How difference between
db.collection.find({ field1: <value>, field2: <value> })
and
db.collection.find({ $and: [{field1: <value>}, {field2: <value>}] })
Upvotes: 0
Views: 199
Reputation: 2769
There's no difference. From the documentation:
MongoDB provides an implicit AND operation when specifying a comma separated list of expressions. Using an explicit AND with the $and operator is necessary when the same field or operator has to be specified in multiple expressions.
Hope my answer was helpful.
Upvotes: 2