From 49e6916e661db9889730a80a9c0f4994ae02c323 Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Mon, 10 Jul 2017 16:54:41 -0700 Subject: [PATCH] dev-guide: document using range_end for prefixes with json Lack of a range_end example has caused some confusion. --- Documentation/dev-guide/api_grpc_gateway.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/dev-guide/api_grpc_gateway.md b/Documentation/dev-guide/api_grpc_gateway.md index 3e99f1f4e..a9629efcf 100644 --- a/Documentation/dev-guide/api_grpc_gateway.md +++ b/Documentation/dev-guide/api_grpc_gateway.md @@ -24,6 +24,11 @@ curl -L http://localhost:2379/v3alpha/kv/put \ curl -L http://localhost:2379/v3alpha/kv/range \ -X POST -d '{"key": "Zm9v"}' # {"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"2","raft_term":"3"},"kvs":[{"key":"Zm9v","create_revision":"2","mod_revision":"2","version":"1","value":"YmFy"}],"count":"1"} + +# get all keys prefixed with "foo" +curl -L http://localhost:2379/v3alpha/kv/range \ + -X POST -d '{"key": "Zm9v", "range_end": "Zm9w"}' +# {"header":{"cluster_id":"12585971608760269493","member_id":"13847567121247652255","revision":"2","raft_term":"3"},"kvs":[{"key":"Zm9v","create_revision":"2","mod_revision":"2","version":"1","value":"YmFy"}],"count":"1"} ``` Use `curl` to watch a key: