const tx = db.transaction("books", "readonly"); const store = tx.objectStore("books"); const index = store.index("by_author"); const request = index.openCursor(IDBKeyRange.only("Fred")); request.onsuccess = function() { const cursor = request.result; if (cursor) { // Called for each matching record. report(cursor.value.isbn, cursor.value.title, cursor.value.author); cursor.continue(); } else { // No more matching records. report(null); } };