I have some Schools
within my database with the Geolocation
value set to {latitude: 0, longitude: 0}
.
I want to query schools based on my user's location, which is t.GeoPoint {_latitude: 48.87513, _longitude: 2.3389439999999695}
.
This is how I query them : var school_query = new Parse.Query("School");
school_query.near("Geolocation", this.geopoint);
school_query.limit(10);
school_query.find().then(...)
The 10 Schools
return have their Geolocation
field set to {latitude: 0, longitude: 0}
. Obviously, this is not what I want.
I tried all I could to exclude those Schools
from the results, such as creating a {0:0} geopoint, and using notEqualTo
it. I tried to limit the results to 10km around my user.
Nothing works, 0 valued schools are still returned first. Is there anyway to circumvent this without having to play with the data?
Any suggestion is most welcome!