Skip to content

openCursor() Issue #60

@neerajjoshi

Description

@neerajjoshi

Hello Team,

I using IndexedDBShim.min.js and jquery.indexeddb.js in project for storing client data on local storage . The add and show data is working fine but I am unable to apply cursor query on it . Below is my code in typical indexed db structure and I want it to change as per jquery.indexeddb.js. Please help me how to change it according to jquery.indexeddb.js wrapper.

var transaction = db.transaction(["users"], "readonly");
var objectStore = transaction.objectStore("users");
var index = objectStore.index("tags");

        var rangeTest = IDBKeyRange.only(tag);
        index.openCursor(rangeTest).onsuccess = function(e) {
        var cursor = e.target.result;
        if (cursor) 
        {
            s += "<h2>Key "+cursor.key+"</h2><p>";
            for(var field in cursor.value) {
            s+= field+"="+cursor.value[field]+"<br/>";
            }
            s+="</p>";
            cursor.continue();
        }

As I am getting continuous error of openCursor() is not a function

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions