loopback mongodb connector

26 views
Skip to first unread message

Paul

unread,
Aug 19, 2015, 4:38:02 AM8/19/15
to LoopbackJS
Good evening,

I'm having a real issue.  I'm trying to do a query, limit, sort, etc.  This is what 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 is the magic sauce to do limit, skip, and sort?


Any help is appreciated.   Thanks

Joseph Simonsen

unread,
Aug 19, 2015, 12:55:16 PM8/19/15
to LoopbackJS
Have you seen our documentation of setting up and using filters here:


There are examples of limit, skip and sort there.
Reply all
Reply to author
Forward
0 new messages