mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctlv3: interactive_v3 del command update
This commit is contained in:
parent
e2d51961dd
commit
83f2fa7adc
@ -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:
|
Suppose the etcd cluster has stored the following keys:
|
||||||
|
|
||||||
```
|
```bash
|
||||||
foo = bar
|
foo = bar
|
||||||
foo1 = bar1
|
foo1 = bar1
|
||||||
foo3 = bar3
|
foo3 = bar3
|
||||||
@ -167,6 +167,20 @@ z
|
|||||||
|
|
||||||
Applications can delete a key or a range of keys from an etcd cluster.
|
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`:
|
Here is the command to delete key `foo`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@ -181,6 +195,29 @@ $ etcdctl del foo foo9
|
|||||||
2 # two keys are deleted
|
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
|
## Watch key changes
|
||||||
|
|
||||||
Applications can watch on a key or a range of keys to monitor for any updates.
|
Applications can watch on a key or a range of keys to monitor for any updates.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user