How to get all values from indexeddb
<p>I am working on storing some data in the indexedDb.</p>

<p>I have created a method which saves the data into the indexedDb. I have stored exactly 49 records. I am trying to retrieve <strong>all of them</strong>. I have written the below code for getting the values. No other code except this line exist in my js file.</p>

<pre><code>function crap() {
var indexedDb = window.indexedDB || window.webkitIndexedDB || window.msIndexedDB;

var IDBKeyRange = window.IDBKeyRange || window.webkitIDBKeyRange;

var openedDb = indexedDb &amp;&amp; indexedDb.open;

var isIndexDbTransactionPossible = window.IDBTransaction || window.webkitIDBTransaction;
if (isIndexDbTransactionPossible) {
    isIndexDbTransactionPossible.READ_WRITE = isIndexDbTransactionPossible.READ_WRITE || 'readwrite';
    isIndexDbTransactionPossible.READ_ONLY = isIndexDbTransactionPossible.READ_ONLY || 'readonly';
}

var request = indexedDb.open('Offline', DB_VERSION);

request.onupgradeneeded = function(e) {
    var db = e.target.result;

    if (db.objectStoreNames.contains('tab')) {
        db.deleteObjectStore('tab');
    }

    var store = db.createObjectStore('tab', {keyPath: 'id', autoIncrement: true});
};

request.onsuccess = function(e) {
    console.log("DB opened");
    var db = e.target.result;

    var store= db.transaction('tab', IDBTransaction.READ_ONLY).objectStore('tab');

    var cursor = store.openCursor();

    cursor.onsuccess = function(event) {

        var c = event.target.result;

        if (c) {
            console.log("New value")
            c.continue();
        }
    };
};
}
</code></pre>

<p>I am seeing "New Value" printed 124 times. I am not sure why the cursor.continue() is not returning null after 49th attempt. Any help is much appreciated.</p>

<p>I am positive that this method is not called more than one time. "DB opened" is logged only one.</p>