Browse Source

Added documentation for sorted listings.

Dustin Oprea 12 years ago
parent
commit
c62603ba73
1 changed files with 32 additions and 0 deletions
  1. 32 0
      README.md

+ 32 - 0
README.md

@@ -330,6 +330,38 @@ curl -X POST http://127.0.0.1:4001/v2/keys/queue -d value=Job2
 }
 ```
 
+To enumerate the in-order keys as a sorted list, use the "sorted" parameter.
+
+```sh
+curl -s -X GET 'http://127.0.0.1:4001/v2/keys/queue?recursive=true&sorted=true' | python -m json.tool
+```
+
+```json
+{
+    "action": "get",
+    "node": {
+        "createdIndex": 2,
+        "dir": true,
+        "key": "/queue",
+        "modifiedIndex": 2,
+        "nodes": [
+            {
+                "createdIndex": 2,
+                "key": "/queue/2",
+                "modifiedIndex": 2,
+                "value": "Job1"
+            },
+            {
+                "createdIndex": 3,
+                "key": "/queue/3",
+                "modifiedIndex": 3,
+                "value": "Job2"
+            }
+        ]
+    }
+}
+```
+
 [lockmod]: #lock