|
8 | 8 | [](https://www.npmjs.com/package/abstract-level)
|
9 | 9 | [](https://www.npmjs.com/package/abstract-level)
|
10 | 10 | [](https://github.com/Level/abstract-level/actions/workflows/test.yml)
|
11 |
| -[](https://codecov.io/gh/Level/abstract-level) |
| 11 | +[](https://codecov.io/gh/Level/abstract-level) |
12 | 12 | [](https://standardjs.com)
|
13 | 13 | [](https://common-changelog.org)
|
14 | 14 | [](https://opencollective.com/level)
|
|
30 | 30 | - [`db.put(key, value[, options][, callback])`](#dbputkey-value-options-callback)
|
31 | 31 | - [`db.del(key[, options][, callback])`](#dbdelkey-options-callback)
|
32 | 32 | - [`db.batch(operations[, options][, callback])`](#dbbatchoperations-options-callback)
|
33 |
| - - [`db.batch()`](#dbbatch) |
| 33 | + - [`chainedBatch = db.batch()`](#chainedbatch--dbbatch) |
34 | 34 | - [`iterator = db.iterator([options])`](#iterator--dbiteratoroptions)
|
35 | 35 | - [`keyIterator = db.keys([options])`](#keyiterator--dbkeysoptions)
|
36 | 36 | - [`valueIterator = db.values([options])`](#valueiterator--dbvaluesoptions)
|
|
56 | 56 | - [`iterator.seek(target[, options])`](#iteratorseektarget-options)
|
57 | 57 | - [`iterator.close([callback])`](#iteratorclosecallback)
|
58 | 58 | - [`iterator.db`](#iteratordb)
|
| 59 | + - [`iterator.count`](#iteratorcount) |
| 60 | + - [`iterator.limit`](#iteratorlimit) |
59 | 61 | - [`keyIterator`](#keyiterator)
|
60 | 62 | - [`valueIterator`](#valueiterator)
|
61 | 63 | - [`sublevel`](#sublevel)
|
@@ -335,9 +337,17 @@ await db.batch([
|
335 | 337 |
|
336 | 338 | The `callback` function will be called with no arguments if the batch was successful or with an error if it failed. If no callback is provided, a promise is returned.
|
337 | 339 |
|
338 |
| -### `db.batch()` |
| 340 | +### `chainedBatch = db.batch()` |
339 | 341 |
|
340 |
| -Create a [`chainedBatch`](#chainedbatch) object, when `batch()` is called with zero arguments. A chained batch can be used to build and eventually commit an atomic batch of operations. Depending on how it's used, it is possible to obtain greater performance with this form of `batch()`. On several implementations however, it is just sugar. |
| 342 | +Create a [chained batch](#chainedbatch), when `batch()` is called with zero arguments. A chained batch can be used to build and eventually commit an atomic batch of operations. Depending on how it's used, it is possible to obtain greater performance with this form of `batch()`. On several implementations however, it is just sugar. |
| 343 | + |
| 344 | +```js |
| 345 | +await db.batch() |
| 346 | + .del('bob') |
| 347 | + .put('alice', 361) |
| 348 | + .put('kim', 220) |
| 349 | + .write() |
| 350 | +``` |
341 | 351 |
|
342 | 352 | ### `iterator = db.iterator([options])`
|
343 | 353 |
|
|
0 commit comments