Sign In Register

How can we help you today?

Start a new topic
Answered

Using Date() in the NoSQL browser

Hi, I'd like to be able to search by date in the NoSQL browser. The date I don't want to have to update, so I'm hoping new Date() will work:


{"ts" : { "$gte" : new Date("}}


But I get an error.


Is there a trick to get this working ?


Best Answer

Hi Christopher, 


You can't use JavaScript like that in the NoSql Exploer I'm afraid. You would need to use an ISO date string in the following format to search here. Check the example below for details.

 

{"ts": { "$lte": {"$date": "2016-11-02T20:00:00.000Z"}}}

 

Try that and let me know how you get on.


Thanks,

Liam


Answer

Hi Christopher, 


You can't use JavaScript like that in the NoSql Exploer I'm afraid. You would need to use an ISO date string in the following format to search here. Check the example below for details.

 

{"ts": { "$lte": {"$date": "2016-11-02T20:00:00.000Z"}}}

 

Try that and let me know how you get on.


Thanks,

Liam

Works thanks!

Login to post a comment