Sign In Register

How can we help you today?

Start a new topic
Answered

How to query dates in NoSQL

How can I query timestamp fields in NoSQL.


I would like a query like:


{ "when": { "$gte": new Date("2016-06-01"), "$lt": new Date("2016-07-02") }}


This is OK in MongoDB, but not in NoSQL.


Thanks for your help !




Best Answer

Hi Eric,


Try this syntax in your find query.


{ "when": { "$gte": {"$date": "2016-06-01T00:00:00.000Z"}, "$lte": {"$date": "2016-07-02T00:00:00.000Z"}}}


Let me know if this works for you


-Pádraig


Answer

Hi Eric,


Try this syntax in your find query.


{ "when": { "$gte": {"$date": "2016-06-01T00:00:00.000Z"}, "$lte": {"$date": "2016-07-02T00:00:00.000Z"}}}


Let me know if this works for you


-Pádraig

Thanks a lot for advice, works perfectly :)

Best

Login to post a comment