Skip to content

Commit ebaebbb

Browse files
authored
Fix IDB cursor prev direction description (#34463)
1 parent 23e1a97 commit ebaebbb

3 files changed

Lines changed: 17 additions & 7 deletions

File tree

files/en-us/web/api/idbcursor/direction/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Possible values are:
2323
- : This direction causes the cursor to be opened at the start of the source.
2424
- `nextunique`
2525
- : This direction causes the cursor to be opened at the start of the source.
26-
For every key with duplicate values, only the first record is yielded.
26+
For every key with duplicate values, only the first-visited record (closest to the start) is yielded.
2727
- `prev`
2828
- : This direction causes the cursor to be opened at the end of the source.
2929
- `prevunique`
3030
- : This direction causes the cursor to be opened at the end of the source.
31-
For every key with duplicate values, only the first record is yielded.
31+
For every key with duplicate values, only the first-visited record (closest to the end) is yielded.
3232

3333
## Examples
3434

files/en-us/web/api/idbobjectstore/opencursor/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,10 @@ openCursor(query, direction)
3939
- : The cursor is opened at the start of the store; then, the cursor returns all records, that are not duplicates,
4040
in the increasing order of keys.
4141
- `prev`
42-
- : The cursor is opened at the start of the store; then, the cursor returns all records, even duplicates,
42+
- : The cursor is opened at the end of the store; then, the cursor returns all records, even duplicates,
4343
in the decreasing order of keys.
4444
- `prevunique`
45-
- : The cursor is opened at the start of the store; then, the cursor returns all records, that are not duplicates,
45+
- : The cursor is opened at the end of the store; then, the cursor returns all records, that are not duplicates,
4646
in the decreasing order of keys.
4747

4848
### Return value

files/en-us/web/api/idbobjectstore/openkeycursor/index.md

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,19 @@ openKeyCursor(query, direction)
3232
range containing only that key. If nothing is passed, this will default to a key range
3333
that selects all the records in this object store.
3434
- `direction` {{optional_inline}}
35-
- : An [`IDBCursorDirection`](https://w3c.github.io/IndexedDB/#enumdef-idbcursordirection) telling the cursor what direction to travel.
36-
Valid values are `"next"`, `"nextunique"`, `"prev"`,
37-
and `"prevunique"`. The default is `"next"`.
35+
- : A string telling the cursor which direction to travel. The default is `next`. Valid values are:
36+
- `next`
37+
- : The cursor is opened at the start of the store; then, the cursor returns all records, even duplicates,
38+
in the increasing order of keys.
39+
- `nextunique`
40+
- : The cursor is opened at the start of the store; then, the cursor returns all records, that are not duplicates,
41+
in the increasing order of keys.
42+
- `prev`
43+
- : The cursor is opened at the end of the store; then, the cursor returns all records, even duplicates,
44+
in the decreasing order of keys.
45+
- `prevunique`
46+
- : The cursor is opened at the end of the store; then, the cursor returns all records, that are not duplicates,
47+
in the decreasing order of keys.
3848

3949
### Return value
4050

0 commit comments

Comments
 (0)