Get to know MDN better
Note: This feature is available in Web Workers.
The IDBRecord interface of the IndexedDB API represents a snapshot of a single record in an IDBObjectStore or IDBIndex.
A request for records using IDBObjectStore.getAllRecords() or IDBIndex.getAllRecords() returns an IDBRequest instance. On success, the returned object's result property is populated with an array of IDBRecord instances.
A value representing the record's secondary key. For an object store record, this will be the same as primaryKey. For an index record, it will be the record's key within the index.
primaryKey Read onlyA value representing the record's primary key. This key is used to represent the record in the IDBObjectStore.
value Read onlyA value representing the record's value.
None.
This example queries an IDBObjectStore for up to 100 records whose keys come after "myKey", with results sorted in reverse order.
The code first creates a transaction on an IDBDatabase named db (omitting the code to open the database), and then uses it to get an IDBObjectStore containing a contacts list. It then calls getAllRecords() on the object store, returning a IDBRequest instance. Event listeners are added to this request for the success and error events. On success, the result event.target.result is logged (this is also available as request.result). This result contains an array of IDBRecord instances. Note that because this is a query on an IDBObjectStore, the key and primaryKey in each record have the same value.
| Indexed Database API 3.0 # record-interface |
Enable JavaScript to view this browser compatibility table.
This page was last modified on Jul 6, 2026 by MDN contributors.
Your blueprint for a better internet.
Portions of this content are ©1998–2026 by individual mozilla.org contributors. Content available under a Creative Commons license.