Open jg-rp opened 2 months ago
@jg-rp Thanks! One issue is that you change to the find function can cause returning a boolean instead of a list of results. I think something like the below should work.
if self.op == "!":
# Negated relative query existence test
- return not datum
+ if not datum:
+ return [datum]
+ else:
+ return []
It would also be nice if you could add your example above to the README.
This pull request implements the not operator (
!
) for negating a relative query when testing for existence. This is a potential solution for #167.Sticking with example data from #167, this example selects values from
data
that don't contain atype
property.To keep this PR small, I've deliberately avoided implementing logical negation for other filter expression types and any refactoring of
ext.filter.Expression
.