mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
etcdctl: document getting all keys with etcdctl3
People keep asking
This commit is contained in:
parent
c1b7e78c60
commit
6fd37dd9a3
@ -115,6 +115,8 @@ RPC: Range
|
|||||||
|
|
||||||
#### Examples
|
#### Examples
|
||||||
|
|
||||||
|
First, populate etcd with some keys:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./etcdctl put foo bar
|
./etcdctl put foo bar
|
||||||
# OK
|
# OK
|
||||||
@ -124,9 +126,33 @@ RPC: Range
|
|||||||
# OK
|
# OK
|
||||||
./etcdctl put foo3 bar3
|
./etcdctl put foo3 bar3
|
||||||
# OK
|
# OK
|
||||||
|
```
|
||||||
|
|
||||||
|
Get the key named `foo`:
|
||||||
|
|
||||||
|
```bash
|
||||||
./etcdctl get foo
|
./etcdctl get foo
|
||||||
# foo
|
# foo
|
||||||
# bar
|
# bar
|
||||||
|
```
|
||||||
|
|
||||||
|
Get all keys:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
./etcdctl get --from-key ''
|
||||||
|
# foo
|
||||||
|
# bar
|
||||||
|
# foo1
|
||||||
|
# bar1
|
||||||
|
# foo2
|
||||||
|
# foo2
|
||||||
|
# foo3
|
||||||
|
# bar3
|
||||||
|
```
|
||||||
|
|
||||||
|
Get all keys with names greater than or equal to `foo1`:
|
||||||
|
|
||||||
|
```bash
|
||||||
./etcdctl get --from-key foo1
|
./etcdctl get --from-key foo1
|
||||||
# foo1
|
# foo1
|
||||||
# bar1
|
# bar1
|
||||||
@ -134,6 +160,11 @@ RPC: Range
|
|||||||
# bar2
|
# bar2
|
||||||
# foo3
|
# foo3
|
||||||
# bar3
|
# bar3
|
||||||
|
```
|
||||||
|
|
||||||
|
Get keys with names greater than or equal to `foo1` and less than `foo3`:
|
||||||
|
|
||||||
|
```bash
|
||||||
./etcdctl get foo1 foo3
|
./etcdctl get foo1 foo3
|
||||||
# foo1
|
# foo1
|
||||||
# bar1
|
# bar1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user