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
Post a Comment