Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Commit f38ee39

Browse files
authored
docs(operations): Make range selector clearer (#711)
1 parent ed61a88 commit f38ee39

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

runtime/kv/operations.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ parts, but not inclusive of an exact match of the key. The prefix selector may
6363
optionally be given a `start` OR `end` key to limit the range of keys returned.
6464
The `start` key is inclusive, and the `end` key is exclusive.
6565

66-
The `range` selector matches all keys that are lexographically between the given
66+
The range selector matches all keys that are lexicographically between the given
6767
`start` and `end` keys. The `start` key is inclusive, and the `end` key is
6868
exclusive.
6969

7070
> Note: In the case of the prefix selector, the `prefix` key must consist only
7171
> of full (not partial) key parts. For example, if the key `["foo", "bar"]`
7272
> exists in the store, then the prefix selector `["foo"]` will match it, but the
73-
> prefix selector `["f"]` will not.
73+
> prefix selector `["f"]` will not. The range selector can use key parts.
7474
7575
The list operation may optionally be given a `limit` to limit the number of keys
7676
returned.
@@ -109,7 +109,7 @@ for await (const res of iter) users.push(res);
109109
console.log(users[0]); // { key: ["users", "alex"], value: "alex", versionstamp: "00a44a3c3e53b9750000" }
110110
console.log(users[1]); // { key: ["users", "sam"], value: "sam", versionstamp: "00e0a2a0f0178b270000" }
111111
112-
// Return all users starting with characters between "a" and "n"
112+
// Return all users starting with characters between "a" and "n" (range selector)
113113
const iter = kv.list<string>({ start: ["users", "a"], end: ["users", "n"] });
114114
const users = [];
115115
for await (const res of iter) users.push(res);

0 commit comments

Comments
 (0)