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

Geolocation Rest always returns same result #999

Closed
3 tasks done
ldmtam opened this issue Mar 12, 2016 · 13 comments
Closed
3 tasks done

Geolocation Rest always returns same result #999

ldmtam opened this issue Mar 12, 2016 · 13 comments

Comments

@ldmtam
Copy link

ldmtam commented Mar 12, 2016

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

Environment Setup

Steps to reproduce

Logs/Trace

I'm using geolocation feature provided from parse server. But parse server always returns the same result array including every location object although i have used the $nearSphere and $maxDistanceInMiles. Please help me out. Thanks in advance.

@flovilmart
Copy link
Contributor

Can you post the request you'r doing?

@ldmtam
Copy link
Author

ldmtam commented Mar 13, 2016

Assume i have a class with 5 geo elements like this:
1

And i want to get 3 objects that are nearest the longitude and latitude coordinate that i have included in the query and with max distance is 1 miles
2

But the result array always return all of my geolocation objects
3
4

Please help me. Thanks!

@tahoecoop
Copy link

I have this issue as well, thanks!

@ldmtam
Copy link
Author

ldmtam commented Mar 29, 2016

Can anyone help me?

@drew-gross
Copy link
Contributor

We have lots of tests that cover Geo Queries, so the information you've provided so far is not enough for us to help you. The best thing you would be able to do is create a reproducible failing test case that demonstrates the issue.

@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.

@hramos
Copy link
Contributor

hramos commented Apr 2, 2016

We are closing this issue due to a lack of sufficient information.

Please refer to this issue for an example of a great bug report.

You may use Server Fault for questions about managing Parse Server.

For code-level and/or implementation-related questions or technical support, please refer to Stack Overflow.

@hramos hramos closed this as completed Apr 2, 2016
@msniff16
Copy link

If I find more time to write up a test case, I will in the future. Wanted to make the community aware that this is a likely issue that has not been addressed.

@javaboyjunior
Copy link

Confused as to why this doesn't have enough information - the exact steps to reproduce are in the original bug report. Create a class with a geopoint column, add some data, query the class with a $nearSphere query with a limit and a distance and you always get back all results. I also have this issue. There's even screen shots...

@flovilmart
Copy link
Contributor

@javaboyjunior We have tests covering this feature, https://github.com/parse-community/parse-server/blob/master/spec/ParseGeoPoint.spec.js#L187 . I'm not sure why you experience such issue.

@javaboyjunior
Copy link

@flovilmart This was very helpful - thank you for the response. For those facing the same problem as myself and others on this thread, the issue was that we were storing the lat and lng components of a geopoint as strings. It isn't obvious from the console as they look like numbers but when I ran a query, latitude and longitude values were in quotes. I edited the values manually in the console which converted them to numbers and distance queries started working. Hopefully this information helps someone as it was tricky to track down.

@flovimart quick question if you don't mind. Now we have this working, we have discovered that 'limit' doesn't work. Shall I open a new ticket for that?

@flovilmart
Copy link
Contributor

@javaboyjunior I should probably not allow strings or convert the strings to numbers for geopoints. We miss that validation somewhere.

For the limit, I'm curious, if you can provide the full logs as well with the newly opened issue that would be helpful!

@javaboyjunior
Copy link

@flovilmart I will get on that - thanks very much for your help!

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

7 participants