Welcome
Login
Sign up
Home
Solutions
Forums
How can we help you today?
Enter your search term here...
Search
Login
or
Signup
to submit a new ticket
Check ticket status
Start a new topic
Discussions
Kinvey Forums
REST API
Query Bug in Backend?
J
Joel Reed
started a topic
over 7 years ago
This query fails to sort the data properly:
/appdata/kid_VTn1d7yTmi/event/?query={"_geoloc":{"$nearSphere":[41.004107798550741,-79.806257851328539],"$maxDistance":100.0}}&resolve_depth=1&sort={'attendees' : -1 }&skip=0
Whereas this query does:
/appdata/kid_VTn1d7yTmi/event/?query={"_geoloc":{"$nearSphere":[41.004107798550741,-79.806257851328539],"$maxDistance":100.0}}&resolve_depth=1&sort=attendees&skip=0
As does this query:
/appdata/kid_VTn1d7yTmi/event/?resolve_depth=1&sort={'attendees' : -1 }&skip=0
Could that be a kinvey/mongodb bug or am I missing something here?
jr
2 Comments
Oldest First
Popular
Newest First
Sorted by
Oldest First
J
Joel Reed
said
over 7 years ago
Also, an ascending sort does work properly. It is only a descending sort with the geolocation query that fails.
/appdata/kid_VTn1d7yTmi/event/?query={"_geoloc":{"$nearSphere":[41.004107798550741,-79.806257851328539],"$maxDistance":100.0}}&resolve_depth=1&sort=attendees&skip=0
Gal
said
over 7 years ago
Hi, the issue is that when you specify the descending sort parameter, you are using single quotes to delimit your field, which is not valid JSON. If you instead use double quotes, your query will work as expected.
Login
or
Signup
to post a comment
More topics in
REST API
Why am I getting "SignatureDoesNotMatch" error when uploading a file?
Why am I getting an "IncompleteRequestBody" error when sending a DELETE request?
Is there a default sort order to collections fetched without an explicit sort query?
Is it possible to set ACLs on all users so that only administrators can query for users (without dis
Flex SDK
Can analytics data be retrieved via Java SDK or REST?
Accesing REST API from a server without a user?
What json is required to assign a user group either read/write?
LDAP Authorization
See all 120 topics
Joel Reed
/appdata/kid_VTn1d7yTmi/event/?query={"_geoloc":{"$nearSphere":[41.004107798550741,-79.806257851328539],"$maxDistance":100.0}}&resolve_depth=1&sort={'attendees' : -1 }&skip=0
Whereas this query does:
/appdata/kid_VTn1d7yTmi/event/?query={"_geoloc":{"$nearSphere":[41.004107798550741,-79.806257851328539],"$maxDistance":100.0}}&resolve_depth=1&sort=attendees&skip=0
As does this query:
/appdata/kid_VTn1d7yTmi/event/?resolve_depth=1&sort={'attendees' : -1 }&skip=0
Could that be a kinvey/mongodb bug or am I missing something here?
jr