MongoDB Data Fetch and Insert ChartJs

๐Ÿ‘:0

You can achieve this using aggregate. Something like below:

db.posts.aggregate([
  {$group: { _id : "$author", count:{$sum:1}}}
])

Leave a comment