diegohaz / querymen

Querystring parser middleware for MongoDB, Express and Nodejs (MEN)
Other
129 stars 34 forks source link

Using custom schema causes wrong pagination #65

Open kbzowski opened 6 years ago

kbzowski commented 6 years ago

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 https://github.com/diegohaz/querymen/issues/50 But that problem is still present.

drochag commented 6 years ago

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