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

Commit 654a496

Browse files
committed
update docs
1 parent b8bca44 commit 654a496

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
88
Database for storing indexed documents. Stores documents by `_id` field by default but you can also specify a custom field to index by.
99

10-
*This is a core data store in [orbit-db](https://github.com/haadcode/orbit-db)*
10+
*This is a core data store in [orbit-db](https://github.com/orbitdb/orbit-db)*
1111

1212
## Table of Contents
1313

@@ -32,8 +32,8 @@ const IPFS = require('ipfs')
3232
const OrbitDB = require('orbit-db')
3333

3434
const ipfs = new IPFS()
35-
const orbitdb = new OrbitDB(ipfs)
36-
const docstore = orbitdb.docstore('db name')
35+
const orbitdb = await OrbitDB.createInstance(ipfs)
36+
const docstore = await orbitdb.docstore('db name')
3737

3838
docstore.put({ _id: 'hello world', doc: 'all the things' })
3939
.then(() => docstore.put({ _id: 'sup world', doc: 'other things' }))
@@ -46,7 +46,7 @@ docstore.put({ _id: 'hello world', doc: 'all the things' })
4646
You can specify the field to index by in the options:
4747

4848
```javascript
49-
const docstore = orbitdb.docstore('db name', { indexBy: 'doc' })
49+
const docstore = await orbitdb.docstore('db name', { indexBy: 'doc' })
5050

5151
docstore.put({ _id: 'hello world', doc: 'some things' })
5252
.then(() => docstore.put({ _id: 'hello universe', doc: 'all the things' }))
@@ -59,7 +59,7 @@ docstore.put({ _id: 'hello world', doc: 'some things' })
5959
You can also use a mapper to query the documents
6060

6161
```javascript
62-
const docstore = orbitdb.docstore('db name')
62+
const docstore = await orbitdb.docstore('db name')
6363

6464
docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
6565
.then(() => docstore.put({ _id: 'hello universe', doc: 'all the things', views: 100 }))
@@ -71,21 +71,21 @@ docstore.put({ _id: 'hello world', doc: 'some things', views: 10 })
7171

7272
## API
7373

74-
*See [orbit-db API documentation](https://github.com/haadcode/orbit-db/blob/master/API.md) for full details*
74+
*See [orbit-db API documentation](https://github.com/orbitdb/orbit-db/blob/master/API.md) for full details*
7575

7676
### docstore(name, options)
7777

7878
Package:
79-
[orbit-db-docstore](https://github.com/shamb0t/orbit-db-docstore)
79+
[orbit-db-docstore](https://github.com/orbitdb/orbit-db-docstore)
8080

8181
```javascript
82-
const db = orbitdb.docstore('orbit.users.shamb0t.profile')
82+
const db = await orbitdb.docstore('orbit.users.shamb0t.profile')
8383
```
8484

8585
By default, documents are indexed by field '_id'. You can also specify the field to index by:
8686

8787
```javascript
88-
const db = orbitdb.docstore('orbit.users.shamb0t.profile', { indexBy: 'name' })
88+
const db = await orbitdb.docstore('orbit.users.shamb0t.profile', { indexBy: 'name' })
8989
```
9090

9191
- **put(doc)**

0 commit comments

Comments
 (0)