diegohaz / diegohaz/querymen

Wrong pagination params on cursor

Open
#50 16 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
134
Forks
34
PR merge metrics
No merged PRs in 30d

Description

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?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.