feat(filters): add more operator types to collection svc filter #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The default operator 'EQ' was switched to filter for the value instead of excluding it. Also, an explicit check for
undefined
in thecollectionFilterBy.value
was added in case the value is actual false, 0, blank or null.New operator type filters:
in
: supportscollectionFilterBy.property
as a nested array, and if thecollectionFilterBy.value
exists in the nested array, the parent item will NOT be filtered. For example:collection: [{ foo: ['bar'] }, { foo: ['foo'] }]
,collectionFilterBy.property: 'foo'
,collectionFilterBy.value: 'bar'
will return the first item in the collection onlynotIn
: oppostie ofin
contains
: assumes thecollectionFilterBy.value
is an array and will check if any of those values exists in thecollectionFilterBy.property
. For example:collection: [{ foo: 'bar' }, { foo: 'foo' }]
,collectionFilterBy.property: 'foo'
,collectionFilterBy.value: [ 'bar', 'foo' ]
will return both itemscloses #63
BREAKING CHANGE: Reversing the 'EQ' filter logic. This was done now because the filter feature was new and it follows the javascript
filter
logic (since equal will filter values equal to the value provided)