title: How to use mongo db aggregate function in meteor with angular js?
body: <p>I want know how to use mongo db aggregate function in meteor with angular.</p>
  
  <p>I added the below packages:</p>
  
  <pre><code>meteor add meteorhacks:aggregate
  meteor add monbro:mongodb-mapreduce-aggregation
  </code></pre>
  
  <p>In angular service, I wrote the code like this,</p>
  
  <pre><code>function getProductDetailsForCompare (skus) {
  
            return $meteor.collection( function() {
                 return Products.aggregate([{ $match: {$or: [{"sku":"777160-001"},{"sku":"777161-001"},{"sku":"728350-B21"}]}}, {$group : {_id : "$sku", price : {$min : "$price"}}}]);
            });               
       }; 
  </code></pre>
  
  <p>When i run this code , giving the below exception.</p>
  
  <pre><code>TypeError: Products.aggregate is not a function
  </code></pre>
  
  <p>Do i need to do any additional setup?
  Do i need to add plugin in app.js?</p>