Closed
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse JS SDK.
Issue Description
Unsorted distance queries aren't supported on the LocalDatastore. Unsorted distance queries uses the $centerSphere
+ $geoWithin
operators found here
Steps to reproduce
it(`LocalDatastore support unsorted distance queries`, async () => {
const object = new TestObject();
const firstPoint = new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 });
object.set({ location: firstPoint });
await object.save();
await object.pin();
const sorted = false;
const query = new Parse.Query(TestObject);
query.withinKilometers(
'location',
new Parse.GeoPoint({ latitude: 40.0, longitude: -30.0 }),
2,
sorted
);
query.fromLocalDatastore();
const results = await query.find();
assert.equal(results.length, 1); // Returns 0 objects
});
Actual Outcome
No objects are returned
Expected Outcome
Should return objects within a certain radius and distance
Environment
Server
- Parse Server version:
5.3.0-alpha.27
- Operating system:
Mac OS 12.6
- Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
Localhost
Database
- System (MongoDB or Postgres):
MongoDB
- Database version:
4.4.0
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
Localhost
Client
- Parse JS SDK version:
3.4.4