Skip to content

Ff153 Add IDBRecord#44540

Open
hamishwillee wants to merge 7 commits into
mdn:mainfrom
hamishwillee:ff153idbrecord
Open

Ff153 Add IDBRecord#44540
hamishwillee wants to merge 7 commits into
mdn:mainfrom
hamishwillee:ff153idbrecord

Conversation

@hamishwillee

@hamishwillee hamishwillee commented Jun 22, 2026

Copy link
Copy Markdown
Collaborator

FF153 Adds support for IDBIndex.getAllRecords() and IDBObjectStore.getAllRecords().

Like all read-write methods in IDB these return an IDBRequest instance, which on success include the "result" of the request in the results object. For these methods the result is an array of IDBRecord objects.

The IDBRecord is in the IDL as an interface. It is more like a dictionary, but in line with MDN policy I've added it as its own interface and cross linked everywhere.

There are a couple of comments inline.

Related docs can be tracked in #44449

@hamishwillee hamishwillee requested review from a team as code owners June 22, 2026 05:09
@hamishwillee hamishwillee requested review from dipikabh and removed request for a team June 22, 2026 05:09
@github-actions github-actions Bot added Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels Jun 22, 2026
Comment thread files/en-us/web/api/idbindex/getallrecords/index.md
Comment thread files/en-us/web/api/idbrequest/result/index.md
@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Preview URLs (5 pages)

External URLs (3)

URL: /en-US/docs/Web/API/IDBRecord
Title: IDBRecord


URL: /en-US/docs/Web/API/IDBRequest
Title: IDBRequest


URL: /en-US/docs/Web/API/IDBRequest/result
Title: IDBRequest: result property

(comment last updated: 2026-07-03 02:48:25)

@hamishwillee hamishwillee changed the title Ff153idbrecord Ff153 Add IDBRecord Jun 22, 2026

@dipikabh dipikabh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @hamishwillee.

I have a few comments and questions for you - let me know if any miss the mark.

Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrequest/result/index.md
Comment thread files/en-us/web/api/idbrequest/result/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbobjectstore/getallrecords/index.md Outdated
Comment thread files/en-us/web/api/idbobjectstore/getallrecords/index.md
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbobjectstore/getallrecords/index.md Outdated
Comment thread files/en-us/web/api/idbobjectstore/getallrecords/index.md
hamishwillee and others added 5 commits June 30, 2026 10:44
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
Co-authored-by: Hamish Willee <hamishwillee@gmail.com>
@hamishwillee

Copy link
Copy Markdown
Collaborator Author

Thanks @dipikabh
Changes applied. Ready for another look.

@hamishwillee hamishwillee requested a review from dipikabh June 30, 2026 00:44

@dipikabh dipikabh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for the updates, @hamishwillee. They're looking good.

Note I've flagged some things in the example code, which are a carryover from getAllRecords(). I'll leave it up to you if you want to fix them in IDBRecord now or in a follow-up when the other pages can also be fixed together.

Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment on lines +43 to +47
const myRecords = (objectStore.getAllRecords({
query,
count: 100,
direction: "prev",
}).onsuccess = (event) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I realize both these issues exist in the examples we have on the two getAllRecords() pages (Looking at the history, I had done the editorial review of those methods when they were first added in #41398)

@hamishwillee hamishwillee Jul 3, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @dipikabh

  • I have split all the exmaples as you suggested - its a much cleaner pattern.
  • Also added as event listeners which is how you are supposed to do these things. Modified in all three examples in same way (modulo the difference in index vs object store).
  • I defined transaction but NOT the database that is needed for it (at some point you get to where all the infrastructure means you no longer have an example that is "basic usage). In any case, I fixed the issue that this was not defined by noting explicitly that this was not done, rather than just not mentioning it.
  • I have similarly updated the examples in the IDBRequest and record to use the addEventListener. Didn't take it further than that for those.

Updates all in ddc1b17

I think it is good. Leaving in case you want to scan it again.

Comment thread files/en-us/web/api/idbrecord/index.md Outdated
Comment thread files/en-us/web/api/idbrecord/index.md Outdated
hamishwillee and others added 2 commits July 3, 2026 11:55
Co-authored-by: Dipika Bhattacharya <dipika@foss-community.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants