samedi 9 janvier 2016

Mongo query to check whether today's date is between 2 others

Vote count: 0

I'm trying to query my db to find collections where today's date lies between dates.start and dates.end.

I'm storing the dates in unix time and using moment().valueOf() to get the current unix time.

                        "dates.startDate":{
                            $lte: moment().valueOf()
                        },
                        "dates.endDate":{
                            $gte: moment().valueOf()
                        }

asked 1 min ago

This entry passed through the Full-Text RSS service - if this is your content and you're reading it on someone else's site, please read the FAQ at http://ift.tt/jcXqJW.



Mongo query to check whether today's date is between 2 others

Aucun commentaire:

Enregistrer un commentaire