Reputation: 7
I'm trying to retrieve documents which can satisfy all the conditions in this query from a embedded document in an array.It's retrieving documents of any of the condition satisfied.
db.getCollection('CollectionName').find(
{ $and: [{ "users.type" : "user" },
{ "users.status" : "2"},
{"users.userId" : ObjectId("Some Object Id")} ]}
Upvotes: 0
Views: 31