Skip to main content
Version: v1.11.0

drop

Operator

drop drop fields from record values

Synopsis

drop <field> [, <field> ...]

Description

The drop operator removes one or more fields from records in the input sequence and copies the modified records to its output. If a field to be dropped is not present, then no effect for the field occurs. In particular, non-record values are copied unmodified.

Examples

Drop of a field

echo '{a:1,b:2,c:3}' | zq -z 'drop b' -

=>

{a:1,c:3}

Non-record values are copied to output

echo '1 {a:1,b:2,c:3}' | zq -z 'drop a,b' -

=>

1
{c:3}