Delete

Description

This command allows you to delete data at a given selector.

If the root node is deleted, an empty node of the same type will be output.

Note that if your root node is anything other than an object or array, dasel will output an empty object.

Available since v1.16.0.

Usage

dasel delete -f <file> <selector>

If --file is used without --out then the source file will be updated.

Example

Delete property

$ echo '{
  "name": "Tom",
  "email": "contact@tomwright.me"
}' | dasel delete -p json '.email'
{
  "name": "Tom"
}

Last updated