Skip to content

Add Negative filter #287

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

Merged
merged 4 commits into from
May 28, 2018
Merged

Add Negative filter #287

merged 4 commits into from
May 28, 2018

Conversation

milosloub
Copy link
Contributor

Only extension of current filter system by adding NotEqual case for filter[attribute]=ne:value

@jaredcnance
Copy link
Contributor

Awesome! Thanks! Would you mind adding tests? You should be able to just add it onto these: https://github.com/json-api-dotnet/JsonApiDotNetCore/blob/master/test/JsonApiDotNetCoreExampleTests/Acceptance/Spec/AttributeFilterTests.cs

@milosloub
Copy link
Contributor Author

Sure, I'll have some problems with testing. Locally tests passes, but after push test fail. I'll investigate this later

@milosloub
Copy link
Contributor Author

milosloub commented May 26, 2018

Test is fixed now. Problem was my clear postgres db in docker container. While running this test, I didn't count with data from previous tests.

Btw I have another idea of extending filter for array use-cases. For example I'm
looking to find those people whose ages are present in the arrayValues.
So "filter[age]=in:15,18,30" would be translated as:
People.Where(s=>arrayValues.Contains(s.age))
What do you think about this solution?

@jaredcnance
Copy link
Contributor

@milosloub that sounds good.

@jaredcnance jaredcnance merged commit 723614d into json-api-dotnet:master May 28, 2018
jaredcnance added a commit that referenced this pull request Aug 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants