Skip to content

Overwriting a value with an undefined/null field will not change the old value #2318

Open
@muja

Description

@muja

Describe the bug

When overwriting an object's value with undefined, it will leave the old value intact

❯ yq -n '.foo = "abc" | .foo = .bar'

Actual behavior

foo: abc

Expected behavior

foo: null

Additional context

❯ jq -n '.foo = "abc" | .foo = .bar'
{
  "foo": null
}

❯ yq -n '.foo = "abc" | .foo = null'
foo: null

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions