Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
query: (rawQuery, value) => {
if (!value.lng || !value.lat || !value.distance) return;
// read more https://docs.mongodb.com/manual/tutorial/query-a-2dsphere-index/
rawQuery['address.geo'] = {
$near: {
$geometry: {
type: 'Point',
coordinates: [value.lng, value.lat],
},
$maxDistance: value.distance, //
},
};
},
})
query: function query(rawQuery, value, resolveParams) {
if (!value.lng || !value.lat || !value.distance) return;
rawQuery['address.geo'] = {
$near: {
$geometry: {
type: 'Point',
coordinates: [value.lng, value.lat] },
$maxDistance: value.distance } };
} }));