cast limit & offest to intenger #12349
jimmywarting
started this conversation in
Ideas
Replies: 1 comment 3 replies
-
@jimmywarting what version of Mongoose are you using? I checked and we do convert Lines 843 to 856 in a792dc3 Lines 877 to 890 in a792dc3 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi, i was using
URLSearchParams
to fetch data with aGET
request as a query filteri didn't want to use json/post cuz i don't save anything and i wanted to take advantage of caching GET requests in browsers too, therefore i used
URLSearchParams
insteadbut the thing was that it returns all numbers as a strings instead of numbers so when i did
Collection.find({}).skip(x).limit(y)
then i got a "FailedToParse" MongoDB error.the simple solution was to cast them into numbers.
but i was thinking that it would be good if you did use
parseInt
in those two (skip & limit) functions too so thatskip("2")
just worksBeta Was this translation helpful? Give feedback.
All reactions