Search code examples
javascriptnode.jsmeteorcron

How to reset user monthly usage in Meteor?


So I have a Meteor app, which allows users to do a particular task a certain number of times per month, depending on their subscription plan.

Their limit, current count and reset date are all stored in a MongoDB collection, but my question is how to reset the count on the specific date?

Would a simple cron-job do the trick?

TIA


Solution

  • Take a look at Meteor Jobs package: https://github.com/vsivsi/meteor-job-collection

    Basically you could schedule a regular job that scans your data to reset your customers.