Issuse with quering geopoints in parse-server
For implementation related questions or technical support, please refer to the Stack Overflow and Server Fault communities.
Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!
- [x] You've met the prerequisites.
- [x] You're running the latest version of Parse Server.
- [x] You've searched through existing issues. Chances are that your issue has been reported or resolved before.
Environment Setup
Localhost with nodejs v4.4.1, mongdb v3.2, parse-server v2.2.2
Steps to reproduce
Logs/Trace
This is my query to get 3 nearest point

But when i excute it, the console show that had some errors with mongdb:

Please help me fix it, thanks.
Looking at the screenshot it seems that the root cause is
unable to find index for $geoNear query
Have you tried adding an index manually?
Thanks @codebreach, it works well now but when i try the same query with Rest API, parse-server always return all the geo objects although i have set the limit = 1. Please help me.

@ldmtam that seems like an issue with the query code itself. Someone who is owner of the project can probably answer this better.
This is a duplicate of #999, so I'm going to close this. We haven't been able to reproduce this issue yet, if you could provide a snippet of code that reliably reproduces this issue, and post it in #999, we'll be able to help.
Haven't had time to write a test case, but I have investigated this issue and can confirm that it occurs when using an $or query that is composed of two queries with separate "geoPoint" objects. When I do the same query with the usual parse server (api.parse.com) it does not fail. When I use my new parse-server with an $or query that is composed of one internal query with a geoPoint (nearSphere) object it works. Adding the second query with geoPoint makes it fail. Again, doing the $or with both geoPoint queries inside the $or works when using api.parse.com and not when using parse-server.