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

Adding offset as an optional way to paginate #33

Open
louisnow opened this issue Mar 6, 2019 · 1 comment
Open

Adding offset as an optional way to paginate #33

louisnow opened this issue Mar 6, 2019 · 1 comment

Comments

@louisnow
Copy link

louisnow commented Mar 6, 2019

Offset would be useful feature similar to mongoose-paginate.
We can add it in a non breaking way like so.

if(options.hasOwnProperty('offset'))  {
// perform skip/offset logic
} else {
// default behaviour
}

Adding this feature could make certain implementations that use the library and have skip but not page in their options not work as they used to. (which shouldn't be our concern but just a heads up in the changelog maybe)

@louisnow louisnow changed the title Adding skip as an optional way to paginate Adding offset as an optional way to paginate Mar 6, 2019
@louisnow
Copy link
Author

louisnow commented Mar 6, 2019

I chose to rename the title from skip feature to offset because mongoose paginate does so. However, I see no other reason to use the word offset instead of skip as mongoose uses skip and compatibility with that is more useful.

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