1

I want to use that in my cloudCode. I'm on Parse server 4.2. I would like to know if it's possible de create a Parse Query and to use agregate on field with geoNear or geoWithin ?

Something like that for example:

const userLat = 43.3;
const userLng = 5.3;
const slotQuery = new Parse.Query(Slot);
return await slotsQuery.aggregate([
  {
     $geoNear: {
       near: [userLat, userLng],
       distanceField: 'meetPointLocation',
       maxDistance: 2,
     }
  }
]);

Thanks everyone for your help!

mistralaix
  • 29
  • 1
  • 4
  • Yes. That should be possible. Here it goes a Parse Server test case that you can use as an example: https://github.com/parse-community/parse-server/blob/9ea355b4635226ae4da17c8cc5fb0321e3fdec5e/spec/ParseQuery.Aggregate.spec.js#L1357 – Davi Macêdo Apr 14 '21 at 15:31

0 Answers0