Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort with skip and limit option is not working (with mongo adapter) #63

Closed
ghost opened this issue Jun 26, 2013 · 2 comments
Closed

Sort with skip and limit option is not working (with mongo adapter) #63

ghost opened this issue Jun 26, 2013 · 2 comments

Comments

@ghost
Copy link

ghost commented Jun 26, 2013

Sort with skip and limit option is not working. It brings all the data on the table. Please refer code below.

var sortData = {
    id: 'asc',
    title: 'asc',
    status: 'asc',
    createdAt: 'asc'
}

     geddy.model.Todo.all({}, {sort:sortData}, { skip: 0, limit: geddy.config.pagelimit }, function (err, todos) {
          console.log(err);
          self.respond({ params: params, todos: todos });

      });
@ghost
Copy link
Author

ghost commented Jun 28, 2013

FOUND THE CORRECT SYNTAX:

 geddy.model.Todo.all({}, {sort:sortData, skip:0, limit:10}, function (err, todos) {
      console.log(err);
      self.respond({ params: params, todos: todos });

  });

@ghost ghost closed this as completed Jun 28, 2013
@mde
Copy link
Contributor

mde commented Jun 28, 2013

Glad you got yourself sorted!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant