node-restful
node-restful copied to clipboard
Limit and Skip don't work.
Current mongodb version: 3.2.0 The previous version that worked: 3.0.8
After calling this endpoint: http://localhost/api/events?limit=20&skip=0 I get the following error: { "name": "MongoError", "message": "Failed to parse: { find: "events", filter: {}, skip: "0", limit: "20" }. 'skip' field must be numeric.", "waitedMS": 0, "ok": 0, "errmsg": "Failed to parse: { find: "events", filter: {}, skip: "0", limit: "20" }. 'skip' field must be numeric.", "code": 9 }
prob. missing a parseInt because mongodb changed something internally.
I think this is fixed in 72c298d153a430f2d03f849a33828e3633093f02, released as version 0.2.5
Let me know if you have any trouble
That did not work. I made sure I upgraded to 0.2.5
This has not been fixed and is still an issue. I have the exact same issue with version 0.2.5
Okay I think I found the bug in model.js line 458:
https://github.com/baugarten/node-restful/blob/master/lib/model.js#L458
This is the current code:
if (props[key]) {
return props[key](val, quer);
}
But it probably should read something like:
if (props[key]) {
return props[key](coerceData(key, val), quer);
}
So that the val variable is actually cleaned up properly.
Why hasn't this been pushed to master? The bug is still there.
I think the version number just hasn't been bumped (and updated to npm). But you can get the bleeding edge version by doing an npm install straight from the github repo (npm install git+https://github.com/reponame)
Aapo Kuuselo [email protected] +1 (469) 999-2590
On Jul 17, 2016, at 1:50 PM, Christian Petersen [email protected] wrote:
Why hasn't this been pushed to master? The bug is still there.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.
This bug is still in the latest npm version. This really needs to be pushed.
Facing the same issue with "^0.2.5" on my packages.json :(
Published another version, 0.2.6, which contains the fix