Use $all:
db.MyCollection.find({
Location: { "$within": { "$center": [[1, 1], 5] } },
Properties: { $all: [ { $elemMatch: { Type: 1, Value: "a" } }, { $elemMatch: { Type: 2, Value: "b" } } ] }
});Sem $all, use $and com dois $elemMatch.
Use $all:
db.MyCollection.find({
Location: { "$within": { "$center": [[1, 1], 5] } },
Properties: { $all: [ { $elemMatch: { Type: 1, Value: "a" } }, { $elemMatch: { Type: 2, Value: "b" } } ] }
});Sem $all, use $and com dois $elemMatch.