|
20 | 20 | - [GET /db/:dbname/:item](#get-dbdbnameitem) |
21 | 21 | - [POST /db/:dbname](#post-dbdbname) |
22 | 22 | - [GET /db/:dbname/iterator](#get-dbdbnameiterator) |
23 | | - - [GET /db/:dbname/all](#get-dbdbnameall) |
| 23 | + - [GET /db/:dbname/index](#get-dbdbnameindex) |
24 | 24 |
|
25 | 25 | ## Install |
26 | 26 |
|
@@ -257,20 +257,39 @@ curl -X GET http://localhost:3000/db/feed/iterator -d 'limit=-1' |
257 | 257 | See [OrbitDB's Iterator API](https://github.com/orbitdb/orbit-db/blob/master/API.md#iteratoroptions-1) |
258 | 258 | for more information. |
259 | 259 |
|
260 | | -### GET /db/:dbname/all |
| 260 | +### GET /db/:dbname/index |
261 | 261 |
|
262 | | -Gets all items from a keyvalue database :dbname. |
| 262 | +Gets information about the data stored in :dbname. |
263 | 263 |
|
264 | | -Returns all items from a keyvalue store as a JSON object. |
| 264 | +Returns information about the data stored as a JSON object. |
265 | 265 |
|
266 | | -Can only be used on keyvalue. |
| 266 | +For the data store keyvalue all records are returned: |
267 | 267 |
|
268 | 268 | ```shell |
269 | | -curl -X GET http://localhost:3000/db/all |
| 269 | +curl -X GET http://localhost:3000/keyvalue/index |
270 | 270 | ``` |
271 | 271 |
|
272 | 272 | ```json |
273 | | -{"Key1":{"name":"Value1"},"Key2":{"name":"Value2"},"projects":"\{["orbitdb","ipfs"]}} |
| 273 | +{"Key":{"name1":"Value1"},"Key2":{"name":"Value2"}} |
| 274 | +``` |
| 275 | + |
| 276 | +Docstore and feed return all records as well as iterators, signature hashes and |
| 277 | +other information about the stored data: |
| 278 | + |
| 279 | +```json |
| 280 | +{"1":{"cid":"zdpuB1sqnXKwgAtJT7vqtrRUsyr4XUZyhume9uJgrrwZmyegu","id":"/orbitdb/zdpuAzpw8yuuMEuffMFcgXafsAye9GqBPwTjmiJijHz3akFhx/docstore","payload":{"op":"PUT","key":1,"value":{"_id":1,"name":"1"}},"next":[],"v":1,"clock":...}} |
| 281 | +``` |
| 282 | + |
| 283 | +The eventlog returns the hash of the last stored item: |
| 284 | + |
| 285 | +```json |
| 286 | +{"id":"/orbitdb/zdpuB1r3rfya65UUjQu6GsBXEmp5gmjvMwRGwkxd4ySwYnBSK/eventlog","heads":["zdpuAu7eTsdWoQ76CdWCbjcsGV3s6duYyUujaHQiGCAZPLWMb"]} |
| 287 | +``` |
| 288 | + |
| 289 | +The counter data store returns information about the current counter value: |
| 290 | + |
| 291 | +```json |
| 292 | +{"id":"04e6de9dd0e8d0069bcc6d8f3ef11cefe63bba6129c32f2cd422a0394814bc6723b26eb62731ee466020b0394d01dd08e4a5123eaad45e4d0840fd796652a22e42","counters":{"04e6de9dd0e8d0069bcc6d8f3ef11cefe63bba6129c32f2cd422a0394814bc6723b26eb62731ee466020b0394d01dd08e4a5123eaad45e4d0840fd796652a22e42":15}} |
274 | 293 | ``` |
275 | 294 |
|
276 | 295 | ### POST|PUT /db/:dbname/add |
|
0 commit comments