I am working on the following document
{ "_id" : 12, "firstName" : "wer", "People" : [ { "uuid" : "123", "name" : "sugun", "person" : [ { "uuid" : "add32", "name" : "ssss" }, { "uuid" : "fdg456", "name" : "gfg" } ] }, { "uuid" : "222", "name" : "kiran" } ] }
I want to get my output as follows
{ "_id" : 456, "People" : [ { "uuid" : "123", "name" : "sugun", "person" : [ { "uuid" : "add32", "name" : "ssss" } ] } ] }
when iam using the following command in mongo shell gives my required output
db.people.aggregate([ {$match: {_id: 12}}, {$unwind: "$People"}, {$unwind: "$People.person"}, {$match: {"People.uuid": "123", "People.person.uuid" : "add32"}} ])
but when iam using the same in my meteorite application aggregate doesnโt work ...... so I can do the same with the find or findOne methods ............. or if there is any possibility to use the aggregate function in my meteorite application ....
source share