title: how to use aggregate function in meteor
body: <p>I'm working on the following document</p>
  
  <pre><code>{
  "_id" : 12,
  "firstName" : "wer",
  "People" : [ 
      {
          "uuid" : "123",
          "name" : "sugun",
          "person" : [ 
              {
                  "uuid" : "add32",
                  "name" : "ssss"
              }, 
              {
                  "uuid" : "fdg456",
                  "name" : "gfg"
              }
          ]
      }, 
      {
          "uuid" : "222",
          "name" : "kiran"
      }
  ]
  } 
  </code></pre>
  
  <p>I want to get my output as following</p>
  
  <pre><code>{
  "_id" : 456,
  "People" : [ 
      {
          "uuid" : "123",
          "name" : "sugun",
          "person" : [ 
              {
                  "uuid" : "add32",
                  "name" : "ssss"
              }
          ]
      }
  ]
  }
  </code></pre>
  
  <p>when iam using following  command in mongo shell it give my required output</p>
  
  <pre><code> db.people.aggregate([
      {$match: {_id: 12}}, 
      {$unwind: "$People"}, 
      {$unwind: "$People.person"}, 
      {$match: {"People.uuid": "123", "People.person.uuid" : "add32"}}
   ])
  </code></pre>
  
  <p>but  when iam  using same in my meteor app  aggregate is not working......
  so can i do the same using find or findOne  methods.............
  or if there is any possibility to use aggregate  function  in my meteor app....</p>