This repository was archived by the owner on Nov 27, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Expand file tree Collapse file tree 1 file changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -169,7 +169,8 @@ curl -X GET http://localhost:3000/db/docstore/1
169169
170170### POST /db/: dbname
171171
172- Creates a new database and returns information about the newly created database.
172+ Creates a new database and returns information about the newly created database
173+ or opens an existing database with the same name.
173174
174175Returns information about the database as a JSON object.
175176
@@ -192,6 +193,23 @@ POST param (this would apply to type docstore only):
192193curl http://localhost:3000/db/docstore -d " create=true" -d " type=docstore" -d " indexBy=name"
193194```
194195
196+ To open an existing database, specify the address of the database. If the
197+ database does not exist locally it will be fetched from the swarm.
198+
199+ The address MUST be URL escaped.
200+
201+ ``` shell
202+ curl http://localhost:3000/db/zdpuAmnfJZ6UTssG5Ns3o8ALXZJXVx5eTLTxf7gfFzHxurbJq%2Fdocstore
203+ ```
204+
205+ By default, OrbitDB will open the database if one already exists with the same
206+ name. To always overwrite the existing database with a new one, pass the
207+ overwrite flag:
208+
209+ ``` shell
210+ curl http://localhost:3000/db/docstore -d " create=true" -d " type=docstore" -d " overwrite=true"
211+ ```
212+
195213### POST|PUT /db/: dbname /iterator
196214
197215Gets items from an eventlog or feed database : dbname .
You can’t perform that action at this time.
0 commit comments