diegohaz / querymen

Querystring parser middleware for MongoDB, Express and Nodejs (MEN)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using custom schema causes wrong pagination

kbzowski opened this issue · comments

If a schema (either empty) is attached to routing,
and I set page and limit parameters in query, "skip" is calculated based on default "limit" value = 30 - not a value from query:

Bug

Skip should be 20 not 30.
In other words, if schema is attached 'skip' is calculated always based on default value.
With no schema attached - everything works fine.

I believe this is duplicate of #50
But that problem is still present.

Check PR #52 , you might find workarounds there and further discussion.