Conversation
correct the default filter
larsga
left a comment
There was a problem hiding this comment.
Thank you for fixing the wrong method call in the documentation. That's much appreciated! 👍
Unfortunately, the other suggested change is wrong (see detail comment). If you can remove that I'll merge the PR.
|
|
||
| ``` | ||
| . == null or . == {} or . == [] | ||
| . == null or . == {} or . == [] or not(.) == false |
There was a problem hiding this comment.
This addition is not correct. As you can see here it really is null, {}, and [] that are the omitted values.
The suggested change would, for example, filter out true, and 5, and so on.
There was a problem hiding this comment.
Yes, that's true, but the example expression says how to reproduce the default behaviour, which is your number 1.
There was a problem hiding this comment.
I think the right fix would be to negate the expression, right?
. != null and . != {} and . != []
When the filter returns true, it means we want to keep the value. So here, we want to keep all values that are (1) not null AND (2) not {} AND (3) not [].
correct the default filter