delete

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.

Arguments and Flags

--output=OUTPUT
Output encoding. Available OUTPUT options are plain (default), json, and xml
KEY
Key to be deleted

Usage

$ vars delete [--output=OUTPUT] [KEY]

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>