How can I store and query repeating date events using mangoes?

I want my users to set up a schedule for their events. It can be one day, or for convenience, I would like to allow them to indicate a repeat event (similar to the destination of Outlook).

Keeping one day will be pretty simple, but how can I save and request a repeat event? I do not need to do it once, because I will just keep it separately, and if they needed another time, I would just create them another event. Therefore, no: every Wednesday at 5 and Thursday at 3.

Examples:

Every monday, tues, wed, thu, fri, every week

Every marriage every week

Every second Tuesday of the month

I asked this a few years ago: How to store and request schedule data? but he used a SQL solution (SQL Server). I want to use Mongo, although the port is in order.

+3
source share
1 answer

How about saving the original date and repeat information? This is an unlimited field for experimentation, and you can come up with a "repeating event format." For instance:

event : {
   date: 17 May 2012 22.45, 
   recurring: "+2d"  # meaning, every second day after the date
}
+2
source

All Articles