Skip to content
This repository was archived by the owner on Nov 27, 2023. It is now read-only.

Docs/https update fix anchors #19

Merged
merged 2 commits into from
Jul 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@
- [POST /db/:dbname/query](#post-dbdbnamequery)
- [Modulus Query](#modulus-query)
- [Range Query](#range-query)
- [POST|PUT /db/:dbname/add](#post-put-dbdbnameadd)
- [POST|PUT /db/:dbname/put](#post-put-dbdbnameput)
- [POST|PUT /db/:dbname/inc](#post-put-dbdbnameinc)
- [POST|PUT /db/:dbname/inc/:val](#post-put-dbdbnameincval)
- [POST|PUT /db/:dbname/access/writ](#post-put-dbdbnameaccesswrite)
- [POST|PUT /db/:dbname/add](#postput-dbdbnameadd)
- [POST|PUT /db/:dbname/put](#postput-dbdbnameput)
- [POST|PUT /db/:dbname/inc](#postput-dbdbnameinc)
- [POST|PUT /db/:dbname/inc/:val](#postput-dbdbnameincval)
- [POST|PUT /db/:dbname/access/writ](#postput-dbdbnameaccesswrite)
- [DELETE /db/:dbname](#delete-dbdbname)
- [DELETE /db/:dbname/:item](#delete-dbdbnameitem)
- [Contribute](#contribute)
Expand Down Expand Up @@ -85,7 +85,7 @@ ignore the the insecure connection.
Lists all databases on the current peer.

```shell
curl http://localhost:3000/dbs
curl https://localhost:3000/dbs
```

```json
Expand All @@ -99,7 +99,7 @@ Gets the details of a database with name :dbname.
Returns information about the database as a JSON object.

```shell
curl http://localhost:3000/db/docstore
curl https://localhost:3000/db/docstore
```

```json
Expand All @@ -115,7 +115,7 @@ Returns the current counter value.
Can only be used on counter.

```shell
curl -X GET http://localhost:3000/db/counter/value
curl -X GET https://localhost:3000/db/counter/value
```

```json
Expand All @@ -131,7 +131,7 @@ Returns a list of found items as a JSON array.
For the data type docstore, :item must be a value identified by the index field (set using indexBy).

```shell
curl -X GET http://localhost:3000/db/docstore/1
curl -X GET https://localhost:3000/db/docstore/1
```

```json
Expand All @@ -147,7 +147,7 @@ Returns a list of matching objects as a JSON array.
Can only be used on eventlog|feed.

```shell
curl -X GET http://localhost:3000/db/feed/iterator
curl -X GET https://localhost:3000/db/feed/iterator
```

```json
Expand All @@ -157,7 +157,7 @@ curl -X GET http://localhost:3000/db/feed/iterator
Additional options can be passed to OrbitDB to return different entries.

```shell
curl -X GET http://localhost:3000/db/feed/iterator -d 'limit=-1'
curl -X GET https://localhost:3000/db/feed/iterator -d 'limit=-1'
```

```json
Expand All @@ -176,7 +176,7 @@ Returns information about the data stored as a JSON object.
For the data store keyvalue all records are returned:

```shell
curl -X GET http://localhost:3000/keyvalue/index
curl -X GET https://localhost:3000/keyvalue/index
```

```json
Expand Down Expand Up @@ -209,7 +209,7 @@ Gets the identity information.
Returns identity as a JSON object.

```shell
curl -X GET http://localhost:3000/identity
curl -X GET https://localhost:3000/identity
```

```json
Expand All @@ -227,7 +227,7 @@ The OrbitDB options ```create=true``` and ```type=eventlog|feed|docstore|keyvalu
must be sent with the POST otherwise an error is thrown.

```shell
curl http://localhost:3000/db/docstore -d "create=true" -d "type=docstore"
curl https://localhost:3000/db/docstore -d "create=true" -d "type=docstore"
```

```json
Expand All @@ -239,7 +239,7 @@ field must be changed then the indexBy flag can be specified as an additional
POST param (this would apply to type docstore only):

```shell
curl http://localhost:3000/db/docstore -d "create=true" -d "type=docstore" -d "indexBy=name"
curl https://localhost:3000/db/docstore -d "create=true" -d "type=docstore" -d "indexBy=name"
```

Parameters can also be passed as JSON. This is useful if additional parameters
Expand All @@ -255,15 +255,15 @@ database does not exist locally it will be fetched from the swarm.
The address MUST be URL escaped.

```shell
curl -X POST http://localhost:3000/db/zdpuAmnfJZ6UTssG5Ns3o8ALXZJXVx5eTLTxf7gfFzHxurbJq%2Fdocstore
curl -X POST https://localhost:3000/db/zdpuAmnfJZ6UTssG5Ns3o8ALXZJXVx5eTLTxf7gfFzHxurbJq%2Fdocstore
```

By default, OrbitDB will open the database if one already exists with the same
name. To always overwrite the existing database with a new one, pass the
overwrite flag:

```shell
curl http://localhost:3000/db/docstore -d "create=true" -d "type=docstore" -d "overwrite=true"
curl https://localhost:3000/db/docstore -d "create=true" -d "type=docstore" -d "overwrite=true"
```

### POST /db/:dbname/query
Expand All @@ -273,7 +273,7 @@ Queries the database :dbname.
Returns a list of found items as a JSON array.

```shell
curl http://localhost:3000/db/docstore/query -X GET -H "Content-Type: application/json" --data '{"values":[]}'
curl https://localhost:3000/db/docstore/query -X GET -H "Content-Type: application/json" --data '{"values":[]}'
```

```json
Expand All @@ -284,7 +284,7 @@ To query a subset of data, a condition can be specified. For example, to
retrieve only those entries which have a total number of likes above 300:

```shell
curl http://localhost:3000/db/docstore/query -X GET -H "Content-Type: application/json" --data '{"propname":"likes","comp":">","values":[300]}'
curl https://localhost:3000/db/docstore/query -X GET -H "Content-Type: application/json" --data '{"propname":"likes","comp":">","values":[300]}'
```

```json
Expand Down Expand Up @@ -316,7 +316,7 @@ Available operator short-codes are:
When using a modulus query, you must supply the divisor and the remainder. For example, to obtain all likes which are multiples of 100, you would specify a divisor 100 and a remainder 0:

```shell
curl -X POST http://localhost:3000/db/docstore/query -H "Content-Type:application/json" --data '{"propname":"likes", "comp":"mod", "values":[100,0]}'
curl -X POST https://localhost:3000/db/docstore/query -H "Content-Type:application/json" --data '{"propname":"likes", "comp":"mod", "values":[100,0]}'
```

```json
Expand All @@ -329,7 +329,7 @@ When specifying a range query, you must supply the min and max
values. For example, to obtain all likes greater than 250 but less than 1000 the min and max must be supplied:

```shell
curl -X GET http://localhost:3000/db/docstore/query -H "Content-Type:application/json" --data '{"propname":"likes", "comp":"range", "values":[250,1000]}'
curl -X GET https://localhost:3000/db/docstore/query -H "Content-Type:application/json" --data '{"propname":"likes", "comp":"range", "values":[250,1000]}'
```

```json
Expand All @@ -345,7 +345,7 @@ Returns the multihash of the new record entry.
Can only be used on eventlog|feed

```shell
curl -X POST http://localhost:3000/db/feed/add -d 'feed-item-1'
curl -X POST https://localhost:3000/db/feed/add -d 'feed-item-1'
```

```json
Expand All @@ -359,7 +359,7 @@ Puts a record to the database :dbname.
Returns a multihash of the record entry.

```shell
curl -X POST http://localhost:3000/db/docstore/put -H "Content-Type: application/json" -d '{"_id":1, "value": "test"}'
curl -X POST https://localhost:3000/db/docstore/put -H "Content-Type: application/json" -d '{"_id":1, "value": "test"}'
```

```json
Expand All @@ -370,7 +370,7 @@ For the keyvalue store, a JSON object containing the variables `key` and
`value` must be passed in the POST data:

```shell
curl -X POST http://localhost:3000/db/keyvalue/put -H "Content-Type: application/json" -d '{"key":"Key","value":{ "name": "Value" }}'
curl -X POST https://localhost:3000/db/keyvalue/put -H "Content-Type: application/json" -d '{"key":"Key","value":{ "name": "Value" }}'
```

### POST|PUT /db/:dbname/inc
Expand All @@ -380,7 +380,7 @@ Increments the counter database :dbname by 1.
Returns a multihash of the new counter value.

```shell
curl -X POST http://localhost:3000/db/counter/inc
curl -X POST https://localhost:3000/db/counter/inc
```

```json
Expand All @@ -394,7 +394,7 @@ Increments the counter database :dbname by :val.
Returns a multihash of the new counter value.

```shell
curl -X POST http://localhost:3000/db/counter/inc/100
curl -X POST https://localhost:3000/db/counter/inc/100
```

```json
Expand All @@ -406,7 +406,7 @@ zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
Adds the id to the list of peers who have write access to the :dbname data store.

```shell
curl -X POST http://localhost:3000/db/docstore/access/write -d 'id=045757bffcc7a4...'
curl -X POST https://localhost:3000/db/docstore/access/write -d 'id=045757bffcc7a4...'
```

```json
Expand All @@ -418,7 +418,7 @@ zdpuAmHw9Tcc4pyVjcVX3rJNJ7SGffmu4EwjodzmaPBVGGzbd
Deletes the local database :dbname. This does not delete any data from peers.

```shell
curl -X DELETE http://localhost:3000/db/docstore
curl -X DELETE https://localhost:3000/db/docstore
```

### DELETE /db/:dbname/:item
Expand All @@ -428,7 +428,7 @@ Deletes the item specified by :item from the database :dbname.
Returns the multihash of the item entry deleted or an error if no item is found.

```shell
curl -X DELETE http://localhost:3000/db/docstore/1
curl -X DELETE https://localhost:3000/db/docstore/1
```

```json
Expand Down