Single Purpose Aggregation

Examples

  • COUNT
  • db.customers.find({status:"AAA"}).count()
  • DISTINCT
  • db.customers.distinct("status").sort()
  • GROUP
  • db.customers.group({
    key: {country:1},
    reduce: function(cur,result)
    {result.bal += cur.acct_balance },
    initial: {bal:0}})



>>
 


+ o -