Closed JohnBrinkman closed 11 months ago
Where some people might prefer the JMESPath behaviour is with this scenario. Given:
[{"a": 1}, {"a": 2}, {"a":3}, {"b": 1}]
the expression: [*].a
currently returns: [1, 2, 3]
But with this change will return: [1, 2, 3, null]
The former result can be found by using a predicate something like:
[?contains(keys(@),"a")].a
or
[*].a | [?@ != null()]
fixed
Inherited from JMESPath, we have the behavior where an array/list construction will omit null entries. e.g. this expression:
`[null, 1, 2, 3]`[*]
yields:[1,2,3]
It would be more consistent (less surprising) if we included null values. If users want to omit them, they can apply a filter. e.g.
`[null, 1, 2, 3]`[?@ != null()]