Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issuse with quering geopoints in parse-server #1246

Closed
3 tasks done
ldmtam opened this issue Mar 29, 2016 · 5 comments
Closed
3 tasks done

Issuse with quering geopoints in parse-server #1246

ldmtam opened this issue Mar 29, 2016 · 5 comments

Comments

@ldmtam
Copy link

ldmtam commented Mar 29, 2016

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!

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
untitled

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

Please help me fix it, thanks.

@codebreach
Copy link
Contributor

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?

@ldmtam
Copy link
Author

ldmtam commented Mar 29, 2016

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.
3
4
5

@codebreach
Copy link
Contributor

@ldmtam that seems like an issue with the query code itself. Someone who is owner of the project can probably answer this better.

@drew-gross
Copy link
Contributor

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.

@msniff16
Copy link

msniff16 commented Apr 1, 2016

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants