From ef1c3217e09c7d3384e8d33f2dbbdc1e35e83dd8 Mon Sep 17 00:00:00 2001 From: Vincent Weevers Date: Sat, 11 Sep 2021 10:01:47 +0200 Subject: [PATCH] Tweak `iterator.seek()` documentation Ref https://github.com/Level/levelup/issues/491#issuecomment-917361384 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 44ec6f9d..3aee4139 100644 --- a/README.md +++ b/README.md @@ -398,9 +398,9 @@ Otherwise, the `callback` function will be called with the following 3 arguments #### `iterator.seek(key)` -seek() is an instance method on an existing iterator object, used to seek the underlying LevelDB iterator to a given key. +Seek the iterator to a given key or the closest key. Subsequent calls to `iterator.next()` will yield entries with keys equal to or larger than `target`, or equal to or smaller than `target` if the `reverse` option passed to `db.iterator()` was true. -By calling seek(key), subsequent calls to next(cb) will return key/values larger or smaller than `key`, based on your reverse setting in the iterator constructor. +If range options like `gt` were passed to `db.iterator()` and `target` does not fall within that range, the iterator will reach its end.