delete

Usage

vars [global options] delete [--output=OUTPUT] <KEY>

Arguments

<KEY>
Key to be deleted

Options

Global options are detailed here.

--output=OUTPUT
Output encoding. Available OUTPUT options are plain (default), json, and xml.
-h | --help
Show help message.

Definition

The delete command deletes a key and its value from Vars.

Note

Some time is required for the deletion to be replicated across instances, so immediate reads of the value may be outdated.

Examples

To confirm that a key has been deleted after executing vars delete <KEY>, wait a little and then execute vars get <KEY>. The output should be blank, showing that the key/value pair has been deleted.

For example, if you have a key mykey and a value myvalue and you execute vars delete mykey, Vars will output a blank line.

To confirm that the delete has worked, wait a moment and execute vars get mykey. The output should be a blank line, matching the above.

Note: If you used vars get <KEY> --output=json to confirm deletion, Vars should return the deleted field as 1:

{
  "key": "testkey",
  "deleted": 1,
  "status": "notfound"
}

If you used vars get <KEY> --output=xml to confirm deletion, Vars should return the <deleted>1</deleted> field:

<GetOutput>
   <key>foo</key>
   <deleted>1</deleted>
   <status>notfound</status>
</GetOutput>