Put document

Description

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

It generally works in the same way as put, but allows you to write entire documents with a single command.

Note that put document will completely overwrite any existing data at the given selector.

Usage

dasel put document -f <file> -d <document-parser> <selector> <document>

Example

Put YAML document into JSON

$ echo '{"people":[]}' | dasel put document -p json -d yaml '.people.[]' 'name: Tom
colours:
- red
- green
- blue'
{
  "people": [
    {
      "colours": ["red", "green", "blue"],
      "name": "Tom"
    }
  ]
}

Last updated