const transaction = db.transaction("name", "readonly");
const objectStore = transaction.objectStore("name");
const request = objectStore.openCursor();
request.onsuccess = (event) => {
const cursor = event.target.result;
if (cursor) {
// cursor.value contains the current record being iterated through
// this is where you'd do something with the result
cursor.continue();
} else {
// no more results
}
};IDBObjectStore: openCursor() method / notebook
IDBObjectStore: openCursor() method
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.