mongodb - Sorting in Loopback Connector Mongo -


i'm having real issue. i'm trying query, limit, sort, etc. i'm doing:

mymodel.find( { where: { "location":                         { "near": { "lat": "80", "lng": 80 }}               },               {  limit: 50, offset: 0, skip: 10,                  sort: { "name": "asc" }               },                function(err, docs) {                   var retval    = docs || [];                   return cb(null, retval);            }); 

what magic sauce limit, skip, , sort?

any appreciated. thanks

mymodel.find( { where: { "location": { "near": { "lat": "80", "lng": 80 }}},             limit: 50,             offset: 0,              skip: 10,              order: "name asc"           },            function(err, docs) {               var retval    = docs || [];               cb(null, retval);        }); 

i think way should look. try reading , documentation under it: https://docs.strongloop.com/display/public/lb/querying+data


Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -