R
R
Ruslan Khissamov2014-10-16 08:34:07
MongoDB
Ruslan Khissamov, 2014-10-16 08:34:07

Custom data fetch from mongodb?

I have the following table in mongodb.
Name, dateStart, dateEnd.
It is required to select data according to the following criterion.
new Date() > dateStart & new Date() < dateEnd

Answer the question

In order to leave comments, you need to log in

1 answer(s)
_
_ _, 2014-10-16
@Rushis

There are no tables in mongodb, there are collections.
What is your sample non-standard? As far as I understand, mongoose supports exactly the same syntax as mongo itself.
find({dateStart: {$lt: new Date()}, dateEnd: {$gt: new Date()}});

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question