{
"city" : "ACMAR",
"loc" : [
-86.51557,
33.584132
],
"pop" : 6055,
"state" : "AL",
"_id" : "35004"
}
- db.zips.aggregate({$group:{_id:'$state',count:{$sum:1}}},{$sort:{count:-1}},{$limit:4})
{
"result" : [
{
"_id" : "TX",
"count" : 1671
},
{
"_id" : "NY",
"count" : 1595
},
{
"_id" : "CA",
"count" : 1516
},
{
"_id" : "PA",
"count" : 1458
}
],
"ok" : 1
}
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.