Added documentation for sorted listings.

release-0.4
Dustin Oprea 2013-12-28 11:37:32 -05:00
parent 3b485e20bb
commit c62603ba73
1 changed files with 32 additions and 0 deletions

View File

@ -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