Loopback's skip and limit filter not working together with where filter

Viewed 956

I'm developing my REST API using Loopback framework. I'm using the concept of pagination in my application and for that i use the skip and limit filter as Loopback's documentation suggest.

But when I use these filters together with the where filter, I'm not getting the expected result.

This is my code:

router.get('/', function(req, res) {
  var filter = {
      where: {feedId: req.query.id},
      limit : req.query.limit,
      skip : req.query.skip
  };

  var Feeds = server.models.feeds;
  Feeds.find(filter, function(err, feeds) {
      res.send(feeds);
  });
});

Both where and limit filters are working perfect when we use it alone. Anyone have any ideas? How can I make it work?

0 Answers
Related