From 0b3c11decbfe86f2f0667f247646552416aae765 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 17 Apr 2021 14:26:44 +0200 Subject: [PATCH] Document chained batch encoding options (Level/levelup#633) --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 828bec7..2bb16b9 100644 --- a/README.md +++ b/README.md @@ -282,15 +282,15 @@ db.batch() .write(function () { console.log('Done!') }) ``` -**`batch.put(key, value)`** +**`batch.put(key, value[, options])`** -Queue a _put_ operation on the current batch, not committed until a `write()` is called on the batch. +Queue a _put_ operation on the current batch, not committed until a `write()` is called on the batch. The `options` argument is passed on to the underlying store; `options.keyEncoding` and `options.valueEncoding` are passed to [`encoding-down`][encoding-down], allowing you to override the key- and/or value encoding of this operation. This method may `throw` a `WriteError` if there is a problem with your put (such as the `value` being `null` or `undefined`). -**`batch.del(key)`** +**`batch.del(key[, options])`** -Queue a _del_ operation on the current batch, not committed until a `write()` is called on the batch. +Queue a _del_ operation on the current batch, not committed until a `write()` is called on the batch. The `options` argument is passed on to the underlying store; `options.keyEncoding` is passed to [`encoding-down`][encoding-down], allowing you to override the key encoding of this operation. This method may `throw` a `WriteError` if there is a problem with your delete.