Skip to content

Wrong pagination params on cursor #50

@drochag

Description

@drochag

I have the following Schema


    new querySchema({
      type: String,
      garment: String,
      brand: String,
      supplier: String,
      name: RegExp
    })

Haven't touched anything regarding pagination or limit, however after updating to 2.1.3 to include the cache problem, which I was having as well, this happens:

http://localhost:9000/branch-products?sort=-createdAt&page=1&limit=10
Mongoose: branchproducts.find({}, { skip: 0, limit: 10, sort: { createdAt: -1 }, fields: {} })

http://localhost:9000/branch-products?sort=-createdAt&page=2&limit=10
Mongoose: branchproducts.find({}, { skip: 30, limit: 10, sort: { createdAt: -1 }, fields: {} })

http://localhost:9000/branch-products?sort=-createdAt&page=3&limit=10
Mongoose: branchproducts.find({}, { skip: 60, limit: 10, sort: { createdAt: -1 }, fields: {} })

http://localhost:9000/branch-products?sort=-createdAt&page=4&limit=10
Mongoose: branchproducts.find({}, { skip: 90, limit: 10, sort: { createdAt: -1 }, fields: {} })


As if the limit was 30. Any ideas?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions