node.js - Loopback near filter returns all objects -


near filter of loopback returns me objects or nothing. tried different option no correct result. maybe i've skipped step. here code:

status.getmeasurementposition = function(userlocation, cb) {   const measurement = status.app.models.measurement;   measurement     .find(       {         where: {               location: { near: userlocation}         },         limit: 3},         function(err,measurements){           cb(null,measurements);         }); } 

userlocation here geopoint object.

here code measurement model

"location":{   "type":"geopoint"       } 

hopefully can me this.


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -