Sign In Register

How can we help you today?

Start a new topic
Answered

Filtering a collection with a range

I created a collection with a date as a property, something like this

 

{
 "_id": {
  "$oid": "5877c7f097f534055e705668"
 },
 "playerID": "58777f8c75e7ef056b809aaa",
 "stickerID": "ben_001",
 "collectedDate": 1484244976902
}

 

Now, I would like to filter all the record that have a date between a range in the NoSQL interface.


Is that possible ?


Best Answer

Hi Omar,


You can query dates in the NoSQL Explorer like so:


The date's I've inserted are as an example.


{

"collectedDate": {"$lte": {"$date": "2017-01-10T00:00:00.000Z"}}, 

"collectedDate": {"$gte": {"$date": "2016-10-22T00:00:00.000Z"}}

}



Let me know if this helps!



-Pádraig



Answer

Hi Omar,


You can query dates in the NoSQL Explorer like so:


The date's I've inserted are as an example.


{

"collectedDate": {"$lte": {"$date": "2017-01-10T00:00:00.000Z"}}, 

"collectedDate": {"$gte": {"$date": "2016-10-22T00:00:00.000Z"}}

}



Let me know if this helps!



-Pádraig


Haven't checked yet but it definitely will, I can tell.


Thanks!

Login to post a comment