Howto manage user stats - categories with amount of times in mongodb


I have and test project where users can make events

Create event:

  1. User write event name
  2. User choose a category for there event eg. running
  3. On the Dashboard users can see there different event categories and with info about how many times they have been eg. running this year and last year?

HOWTO manage that kind of info in a Mongodb?

If you just want to get the amount of event documents of a certain type you can use the count on the query cursor (using a Meteor Method):

getEventCount() {
  return EeventCollection.find({ name: 'Conference X' }).count()