node-restful icon indicating copy to clipboard operation
node-restful copied to clipboard

Limit and Skip don't work.

Open muliyul opened this issue 9 years ago • 9 comments

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.

muliyul avatar Jan 09 '16 20:01 muliyul

I think this is fixed in 72c298d153a430f2d03f849a33828e3633093f02, released as version 0.2.5

Let me know if you have any trouble

baugarten avatar Jan 11 '16 01:01 baugarten

That did not work. I made sure I upgraded to 0.2.5

muliyul avatar Jan 11 '16 01:01 muliyul

This has not been fixed and is still an issue. I have the exact same issue with version 0.2.5

karvapallo avatar Mar 13 '16 11:03 karvapallo

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.

karvapallo avatar Mar 13 '16 11:03 karvapallo

Why hasn't this been pushed to master? The bug is still there.

fnky avatar Jul 17 '16 18:07 fnky

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.

karvapallo avatar Jul 17 '16 23:07 karvapallo

This bug is still in the latest npm version. This really needs to be pushed.

OmgImAlexis avatar Jan 28 '17 05:01 OmgImAlexis

Facing the same issue with "^0.2.5" on my packages.json :(

matheo avatar Feb 13 '17 01:02 matheo

Published another version, 0.2.6, which contains the fix

baugarten avatar Feb 13 '17 19:02 baugarten