Mongodb: Find every x days

Asked

Viewed 19 times

1

[Mongodb] Guys, I’m in the following situation: I have several documents saved with the following structure:

{ ..., repetir : "semanal", a_cada: 2 }

In short, I have a cron running daily and I need to fetch the documents according to the configuration of each document. In the case of the above document, the query needs to return this document every two weeks. There are cases where the document will have different parameters, such as ex.:

{ repetir : "diariamente", a_cada: 3 }

I thought about creating a start date and from there on saving the next dates according to the parameters of each document. But that doesn’t sound cool...

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.