I would like to know how to build a query to select players with a creation date greater than a certain timestamp value.
In the NoSQL interface I tried the following but it's not working:
Collection: player
Query: {created: {$gt: 1422075600}}
When querying date fields, you need to let mongo know the type you are looking for. This requires wrapping the epoch time in a $date and a $numberLong
{"created": { "$gt" : { "$date": { "$numberLong": "1427748260201" } } } }
In the Tech Support's example, make sure you specify the timestamp value in String, or you'll get an error response like "java.lang.Long cannot be cast to java.lang.String".
Christian Gauthier
I would like to know how to build a query to select players with a creation date greater than a certain timestamp value.
In the NoSQL interface I tried the following but it's not working:
Collection: player
Query: {created: {$gt: 1422075600}}
When querying date fields, you need to let mongo know the type you are looking for. This requires wrapping the epoch time in a $date and a $numberLong
{"created": { "$gt" : { "$date": { "$numberLong": "1427748260201" } } } }
1 person has this question
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstTech Support
When querying date fields, you need to let mongo know the type you are looking for. This requires wrapping the epoch time in a $date and a $numberLong
{"created": { "$gt" : { "$date": { "$numberLong": "1427748260201" } } } }
Tochi, Tomokazu
In the Tech Support's example, make sure you specify the timestamp value in String, or you'll get an error response like "java.lang.Long cannot be cast to java.lang.String".
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics