Skip to content

|= empty does not work as expected in v1.6 #2051

@kpym

Description

@kpym

Describe the bug
Following the documentation |= empty is supposed to delete the element.
But when multiple elements are set to empty it does not work properly.

To Reproduce
query: (.[] | select(. >= 2)) |= empty
input: [1,5,3,0,7]
output: [1,3,7]

Expected behavior
output: [1,0]

Environment:
jqplay

Note

  • If you replace >=2 with >=7 then 7 is deleted.
  • If you replace >=2 with >=5 then only 5 is deleted.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions