Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "_id" : ObjectId(someId),
- sourceId: someId,
- "objArr" : [
- {
- "fieldA" : someValue,
- "fieldB" : someValue
- },
- {
- "fieldA" : someValue,
- "fieldB" : someValue
- },
- ...etc
- ]
- }
- db.table.aggregate([
- {$match:{_id:1}},
- {$unwind:"$coll"},
- {$match:{"coll.fieldA":{$gt:10},"coll.fieldB":{$lt:20}}},
- {$project:{"fieldA":"$coll.fieldA","fieldB":"$coll.fieldB"}}
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement