-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Querying date using Rest API where clause #3543
Comments
Hi @Aure77 - would you mind adding information about which adapter and Sails version you're using? Thanks! |
Sails version : 0.12.0-rc6 |
@Aure77 So @particlebanana did some work tracking this down, and here's the situation: In this particular case, the fix is in I also wanted to take some time to provide background on this for your future reference, and for anyone else reading this who wants to learn more about how Waterline is architected or interested in contributing. tldr; There are a few different longer-term roadmap items we're working on that will help make issues like these easier to prevent cross-adapter in the future.
|
…ject (and a few other trivial formatting/code-convention tweaks).
@Aure77 just published a pre-release patch of sails-disk-- would you try it out when you have a sec? # in the root folder of your Sails app:
npm install sails-disk@beta --force Thanks! |
After updating sails-disk, I am always experiencing same issue. About the related pull request, where.js seems to already handle date comparison ? : |
@Aure77 correct, using query params in the blueprint API, you'll always need to use JSON encoding (double quotes) My bad, should have caught that earlier, but couldn't tell from your original post because of the URL encoding. Regardless, I don't believe this should have worked prior to the update because sails-disk wasn't passing in the expected schema to wl-criteria (unless i'm missing something) |
0.12.1 has been released which points to the updated version of Waterline and its dependencies. Tested and confirmed that this is fixed! |
If I send this where clause in a rest api call :
{'updatedAt': {'>':'2016-01-01T00:00:00.000Z'}
(updatedAt greater than 2016-01-01)
With this url for example :
http://localhost:1337/api/rest/tournament?where={%27updatedAt%27:{%27%3E%27:%272016-02-02T10:57:08.976Z%27}}
This will output data without filtering by updatedAt :
Test2 should not be returned.
What is the correct way to querying date using where clause (in the rest api) ?
The text was updated successfully, but these errors were encountered: