I am working on a project where I have to send a campaign mail to the users on specific date and time.
Technology : Node, Rethinkdb/Couchdb
Please do not suggest a cron job.
What I have thought to use : I will be using a custom trigger where db will fires an event by checking the current date with the saved campaign dates(start date and end date). And if it matches with the campaign date(i.e. current date between start date and end date), I will run the nodejs script to send a mail.
So is there any feature/functionality that couchdb/rethinkdb provides for manual triggering which can check the values in db and based on that can execute a script?
Or any other solution for this?
Thanks in advance.
I found a work around on this. I used a node schedule module to execute script for sending a mail. In this, the problem I was facing that whenever the server was restarting the cron was getting flushed, so I created them every time the server was restarting by putting them in mongodb.