You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11-9
Original file line number
Diff line number
Diff line change
@@ -26,18 +26,18 @@ async function doDatabaseStuff() {
26
26
autoload: true // so that we don't have to call loadDatabase()
27
27
})
28
28
29
-
await DB.insertAsync([{
29
+
await DB.insert([{
30
30
num: 1, alpha: 'a'
31
31
}, {
32
32
num: 2, alpha: 'b'
33
33
}])
34
34
35
-
let document = await DB.findOneAsync({ num: 1 })
35
+
let document = await DB.findOne({ num: 1 })
36
36
37
37
// use NeDB cursors:
38
38
let documents = await DB.cfind({})
39
39
.projection({ num: 1, _id: 0 })
40
-
.execAsync()
40
+
.exec()
41
41
}
42
42
43
43
doDatabaseStuff()
@@ -48,18 +48,20 @@ API
48
48
49
49
## datastore(options)
50
50
51
-
Returns an extended `nedb.Datastore` instance (`options` are passed through to the NeDB constructor), with promisified methods (suffixed with 'Async').
51
+
Returns an object that proxies to an internal `nedb.Datastore` instance (`options` are passed through to the NeDB constructor), with promisified methods.
52
52
53
-
For example, you may use `findAsync(...)`, `insertAsync(...)`, etc.
54
-
55
-
It also includes the two extension methods `cfind(...)`, and `cfindOne(...)` that return promisified cursors, so that you may do:
53
+
It also includes extension methods `cfind(...)`, `cfindOne(...)`, and `ccount(...)` that return promisified cursors, so that you may do:
56
54
57
55
```
58
-
let results = await myDataStore.cfindA({ moo: 'goo' })
56
+
let results = await myDataStore.cfind({ moo: 'goo' })
0 commit comments