๐:0
You can achieve this using aggregate. Something like below:
db.posts.aggregate([
{$group: { _id : "$author", count:{$sum:1}}}
])
๐:0
You can achieve this using aggregate. Something like below:
db.posts.aggregate([
{$group: { _id : "$author", count:{$sum:1}}}
])