-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
?limit and ?skip does not work? #40
Comments
@johnsonice can you provide example urls that you used, which didn't work? |
@zackurben thanks for your quick response here is an example no luck with ?skip at all. I am very new to this. it could be I made a stupid mistake somewhere, but i just can't figure it out |
@cycz1235 both skip and limit should work as follows: example.com/resource?limit=5 You can actually see them in the tests here: https://github.com/travist/resourcejs/blob/master/test/test.js#L688-L734 Just for background knowledge, what version of node are you running? I don't think this is an issue with ResourceJS, since the tests haven't complained, but maybe the version will tell us more. Zack |
@zackurben i am running on node v5.4.0 |
Did you ever get this handled? I was having the same issue. On node 6.9.1. Setting limit without a constraint returns just fine of course. In looking into it I think that this has been fixed or at least the code is currently much different in the master than what I was using in my project. I think at issue is that your tutorial (maybe @johnsonice was using this? https://www.youtube.com/watch?v=OhPFgqHz68o&t=3775s) If they followed that or just used https://github.com/travist/meanapp/tree/resourcejs/server to get started, it calls for v0.1.25, and this version still suffers from the bug that was fixed on 4/5/16 62ff2a5 I fixed it in that old version, in case anyone is unsure about the consequences of using the current version in their project by changing lines 323-324
Because for some reason it was not being considered an int. Btw, @travist Thanks for the help in getting me started with my first REST API - I almost got excited that I had found and fixed a bug ;) for you. |
Is there a place in the docs where the use of limit, skip etc... are mentioned? I see tests for them, but nothing mentioning their use. |
I followed the documentation to set server side code. Everything else works fine, but for some reason ?limit and ?skip in url does not work.
i am getting:
{
"status": 500,
"message": "Failed to parse: { find: "cities", filter: {}, limit: "5" }. 'limit' field must be numeric.",
"errors": {}
}
any suggestions?
here is all the dependency versions:
Here is my server side code
The text was updated successfully, but these errors were encountered: