You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Was trying to delete all null objects/values from my JSON, but using the paths(node_filter) function to generate their paths was unsuccessful.
To Reproduce
Using an example from the Docs, and filter as used on jqplay (using // for comment just over here)
The same issue seems to extend to all other node_filter it seems, since only true values are produced, for scalar, and false or null values, for scalar | not.
Expected behavior
For any given pre-defined node_filter the output should consist of the values satisfying them.
Seems to be a dup of #1163. A quick look into the definition of the current paths function, node_filter is expected to output a boolean. So paths(type == "boolean") and paths(isempty(values)|not) will work as expected. When using some select function as its argument, filtering out works due to backtracking, but if the value is falsy, the path is also removed.
Describe the bug
Was trying to delete all null objects/values from my JSON, but using the
paths(node_filter)
function to generate their paths was unsuccessful.To Reproduce
Using an example from the Docs, and filter as used on jqplay (using // for comment just over here)
The same issue seems to extend to all other
node_filter
it seems, since only true values are produced, forscalar
, and false or null values, forscalar | not
.Expected behavior
For any given pre-defined
node_filter
the output should consist of the values satisfying them.Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: