Skip to content

Warn when using skip without sort #7579

@199911

Description

@199911

Do you want to request a feature or report a bug?
Bug

What is the current behavior?
Populate with options, skip does not work when sort not defined
.populate({ options: {skip, limit} })

If the current behavior is a bug, please provide the steps to reproduce.
https://github.com/199911/mongoose-populate-bug/blob/master/index.js#L98

What is the expected behavior?
Story list have stories [A, B, C]
expect .populate({ options: {skip: 0, limit: 1} }) return A
expect .populate({ options: {skip: 1, limit: 1} }) return B
but .populate({ options: {skip: 1, limit: 1} }) still return A

Please mention your node.js, mongoose and MongoDB version.
Node,js 8, mongoose 5, MongoDB 4

Metadata

Metadata

Assignees

No one assigned

    Labels

    developer-experienceThis issue improves error messages, debugging, or reporting

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions