etcdctlv3: interactive_v3 del command update

This commit is contained in:
sharat 2016-09-26 19:35:07 +05:30
parent e2d51961dd
commit 83f2fa7adc

View File

@ -48,7 +48,7 @@ Applications can read values of keys from an etcd cluster. Queries may read a si
Suppose the etcd cluster has stored the following keys:
```
```bash
foo = bar
foo1 = bar1
foo3 = bar3
@ -167,6 +167,20 @@ z
Applications can delete a key or a range of keys from an etcd cluster.
Suppose an etcd cluster already has the following keys:
```bash
foo = bar
foo1 = bar1
foo3 = bar3
zoo = val
zoo1 = val1
zoo2 = val2
a = 123
b = 456
z = 789
```
Here is the command to delete key `foo`:
```bash
@ -181,6 +195,29 @@ $ etcdctl del foo foo9
2 # two keys are deleted
```
Here is the command to delete key `zoo` with the deleted key value pair returned:
```bash
$ etcdctl del --prev-kv zoo
1 # one key is deleted
zoo # deleted key
val # the value of the deleted key
```
Here is the command to delete keys having prefix as `zoo`:
```bash
$ etcdctl del --prefix zoo
2 # two keys are deleted
```
Here is the command to delete keys which are greater than or equal to the byte value of key `b` :
```bash
$ etcdctl del --from-key b
2 # two keys are deleted
```
## Watch key changes
Applications can watch on a key or a range of keys to monitor for any updates.