Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "_id": "5b506dccc00e755288ceaec6",
- "title": "Mercedes",
- "URL": "Null",
- "price": 2700000,
- "region": "Mumbai",
- "Man_year": 2013
- },
- {
- "_id": "5b506dccc00e755288ceaec6",
- "title": "Ferrari",
- "URL": "Null",
- "price": 30000,
- "region": "China",
- "Man_year": 2013
- }
- ]
- [{"_id":{"man_year":2010},"countofcars":2,{"regions":{"Mumbai","China"}}}
- db.collection('collection').aggregate([{ $group: { _id: {man_year:"$Man_year",region:"$region"}, countofcars: { $sum: 1 } } }]).toArray(function (err, results) {
Add Comment
Please, Sign In to add comment