From 971d3046eb59cfe56b7b7c9c937f3e8af4d04bc6 Mon Sep 17 00:00:00 2001 From: 1-byte-man <56204784+1-byte-man@users.noreply.github.com> Date: Sun, 6 Oct 2019 20:59:07 -0400 Subject: [PATCH 1/4] Added DataBase types to API.md --- API.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/API.md b/API.md index 139e458..b52194a 100644 --- a/API.md +++ b/API.md @@ -98,6 +98,12 @@ const db = await orbitdb.keyvalue('profile') ### orbitdb.create(name, type, [options]) > Creates and opens an OrbitDB database. +* [log](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress): an imutable (write only) log database. Useful for transactions lists. +* [feed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress): a mutable log database. Useful for comments of a blog. +* [keyvalue](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress): Useful for load data from keywords or an id. +* [docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options): a JSON objects storage. Useful for user data or forum posts. +* [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data as an order list or playlist. + Returns a `Promise` that resolves to [a database instance](#store-api). `name` (string) should be the database name, not an OrbitDB address (i.e. `user.posts`). `type` is a supported database type (i.e. `eventlog` or [an added custom type](https://github.com/orbitdb/orbit-db#custom-store-types)). `options` is an object with any of the following properties: - `accessController` (object): An object, as shown in the example below, containing the key `write` whose value is an array of hex encoded public keys which are used to set write access to the database. `["*"]` can be passed in to give write access to everyone. See the [GETTING STARTED](https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md) guide for more info. (Default: uses the OrbitDB identity id `orbitdb.identity.id`, which would give write access only to yourself) From 8200c34e3af4fe49f8b17a25616b0ec11bc7bb93 Mon Sep 17 00:00:00 2001 From: 1-byte-man <56204784+1-byte-man@users.noreply.github.com> Date: Sun, 6 Oct 2019 21:08:29 -0400 Subject: [PATCH 2/4] Fix API.md error --- API.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/API.md b/API.md index b52194a..da4aa6e 100644 --- a/API.md +++ b/API.md @@ -95,8 +95,7 @@ const db = await orbitdb.keyvalue('profile') ## Public Instance Methods -### orbitdb.create(name, type, [options]) -> Creates and opens an OrbitDB database. +Before to start you've to know that OrbitDB has different types of databases each one made to satisfy a different purpose. The databases that you can create are: * [log](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress): an imutable (write only) log database. Useful for transactions lists. * [feed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress): a mutable log database. Useful for comments of a blog. @@ -104,6 +103,10 @@ const db = await orbitdb.keyvalue('profile') * [docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options): a JSON objects storage. Useful for user data or forum posts. * [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data as an order list or playlist. + +### orbitdb.create(name, type, [options]) +> Creates and opens an OrbitDB database. + Returns a `Promise` that resolves to [a database instance](#store-api). `name` (string) should be the database name, not an OrbitDB address (i.e. `user.posts`). `type` is a supported database type (i.e. `eventlog` or [an added custom type](https://github.com/orbitdb/orbit-db#custom-store-types)). `options` is an object with any of the following properties: - `accessController` (object): An object, as shown in the example below, containing the key `write` whose value is an array of hex encoded public keys which are used to set write access to the database. `["*"]` can be passed in to give write access to everyone. See the [GETTING STARTED](https://github.com/orbitdb/orbit-db/blob/master/GUIDE.md) guide for more info. (Default: uses the OrbitDB identity id `orbitdb.identity.id`, which would give write access only to yourself) From 4cfe721445362e3e955127c33f23afc581cd4c37 Mon Sep 17 00:00:00 2001 From: 1-byte-man <56204784+1-byte-man@users.noreply.github.com> Date: Sun, 6 Oct 2019 21:31:43 -0400 Subject: [PATCH 3/4] Grammar fixes to API.md --- API.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/API.md b/API.md index da4aa6e..3fa82b7 100644 --- a/API.md +++ b/API.md @@ -95,13 +95,13 @@ const db = await orbitdb.keyvalue('profile') ## Public Instance Methods -Before to start you've to know that OrbitDB has different types of databases each one made to satisfy a different purpose. The databases that you can create are: +Before to start you've to know that OrbitDB has different types of databases. Each one made to satisfy a different purpose. The databases that you can create are: * [log](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress): an imutable (write only) log database. Useful for transactions lists. * [feed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress): a mutable log database. Useful for comments of a blog. * [keyvalue](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress): Useful for load data from keywords or an id. -* [docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options): a JSON objects storage. Useful for user data or forum posts. -* [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data as an order list or playlist. +* [docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options): a JSON documents database. Useful for user data or other structured data. +* [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data as could be an order list or a playlist. ### orbitdb.create(name, type, [options]) From aa738484aeac0f898ef59ddaf2e12feabe737b84 Mon Sep 17 00:00:00 2001 From: 1-byte-man <56204784+1-byte-man@users.noreply.github.com> Date: Mon, 7 Oct 2019 10:33:15 -0400 Subject: [PATCH 4/4] Grammar fixes --- API.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/API.md b/API.md index 3fa82b7..8db47c0 100644 --- a/API.md +++ b/API.md @@ -95,13 +95,13 @@ const db = await orbitdb.keyvalue('profile') ## Public Instance Methods -Before to start you've to know that OrbitDB has different types of databases. Each one made to satisfy a different purpose. The databases that you can create are: +Before starting, you should know that OrbitDB has different types of databases. Each one satisfies a different purpose. The databases that you can create are: * [log](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdblognameaddress): an imutable (write only) log database. Useful for transactions lists. -* [feed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress): a mutable log database. Useful for comments of a blog. -* [keyvalue](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress): Useful for load data from keywords or an id. +* [feed](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbfeednameaddress): a mutable log database. Useful for blog comments. +* [keyvalue](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbkeyvaluenameaddress): Useful for loading data from keywords or an id. * [docs](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbdocsnameaddress-options): a JSON documents database. Useful for user data or other structured data. -* [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data as could be an order list or a playlist. +* [counter](https://github.com/orbitdb/orbit-db/blob/master/API.md#orbitdbcounternameaddress): Useful for ordered data (like an ordered list or a playlist.) ### orbitdb.create(name, type, [options])