Closed LucasBrazi06 closed 4 years ago
Example of MongoDB request:
db.getCollection('5be7fb271014d90008992f06.chargingstations').aggregate([
{
$geoNear: {
near: { type:"Point", coordinates: [ -0.395254, 49.325835 ]}, => your location
distanceField: "distance",
distanceMultiplier: 0.001, => conversion m/km
maxDistance: 20000, => distance maximale en mètre
spherical: true
}
},
{
$project : { "coordinates": 1, "distance": 1}
}
])
Done & Tested