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

Is this repo being maintained by someone? #128

Open
nouman91 opened this issue Nov 27, 2017 · 3 comments
Open

Is this repo being maintained by someone? #128

nouman91 opened this issue Nov 27, 2017 · 3 comments

Comments

@nouman91
Copy link

No description provided.

@it-nalon
Copy link

it-nalon commented Dec 3, 2017

Hi, I think you can achieve pagination directly in mongoose without effort right now:

await Model
    .find(query)
    .skip(pagination.skip)
    .limit(pagination.limit)
    .select(fields)
    .sort(sort);

@toantd90
Copy link

@it-nalon How can you achieve total and pages directly in mongoose?

@dskrvk
Copy link

dskrvk commented Jul 27, 2018

total would be either countDocuments (if the result set is small) or estimatedDocumentCount. You can calculate pages yourself.

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

4 participants