Skip to content
This repository was archived by the owner on Dec 1, 2024. It is now read-only.

Commit ef1c321

Browse files
committed
Tweak iterator.seek() documentation
Ref Level/levelup#491 (comment)
1 parent aa649bf commit ef1c321

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,9 @@ Otherwise, the `callback` function will be called with the following 3 arguments
398398

399399
#### `iterator.seek(key)`
400400

401-
<code>seek()</code> is an instance method on an existing iterator object, used to seek the underlying LevelDB iterator to a given key.
401+
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.
402402

403-
By calling <code>seek(key)</code>, subsequent calls to <code>next(cb)</code> will return key/values larger or smaller than `key`, based on your <code>reverse</code> setting in the iterator constructor.
403+
If range options like `gt` were passed to `db.iterator()` and `target` does not fall within that range, the iterator will reach its end.
404404

405405
<a name="iterator_end"></a>
406406

0 commit comments

Comments
 (0)