MongoError: Failed to parse 'limit' field must be numeric
See original GitHub issueKind of “straight forward” that ‘limit’ field must be numeric, but in scenario that I got limit from req.query.limit
in Express it brings in some, in my opinion, unnecessary “string to number conversion code”.
In version 4 everything worked also if limit
was string. Not realy a bug, but maybe you can bring this string conversion back in mongoose-paginate core?
Issue Analytics
- State:
- Created 8 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
'the limit must be specified as a number' error when using req ...
The fix is to use parseInt like this: var show = parseInt( req.query.show ), // the number of items to show per page....
Read more >Unable to Parse Integers in updateMany Command - MongoDB
And get this error message: **MongoServerError:** Failed to parse number 'helpful' in $convert with no onError value: Did not consume whole ...
Read more >JavaScript Developers Guide | Parse - Parse Docs
Parse automatically figures out which data has changed so only “dirty” fields will be sent to the Parse Cloud. You don't need to...
Read more >Looker error catalog | Google Cloud
There is a typo in a field name or in a reference to the field. · The field is excluded from an Explore...
Read more >Does not work search | NodeBB
MongoError : Failed to parse: { find: "searchpost", filter: {}, projection: { _id: 0, id: 1 }, limit: "50" }. 'limit' field must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
like cmd talk to you, the value of “limit” must be a number value, my code alse have this bug ,i just add
parseInt()
,like thisquery.limit(parseInt(param.pageSize))
, it become workThis was not an issue in earlier version of mongodb(2.x) it is only when i switched to 3.2.1