Query based on Time
I've a collection where I save date and time of the users last access. I have to send a notification exactly on same date and time next month. How can I write the query for it?
I already have a cron job setup. I just want to know how to write the query for it. I've previously worked with date, but I'm not sure how to query based on date and time.
Any help much appreciated. Thank you ..
3 Replies
I've a cron job which runs every 30 minutes.
I want to fetch all the users who last accessed the app in that period(last month) to be notified.
I hope this query works?
do you need the AND?
Ah .. it doesn't make sense to have it!!
Thank you for pointing out.
I'm editing it now.
@fotoflo Do you think the logic is correct?