语言

Menu
Sites
Language
IndexedDB Compound Index not working

As we all know, Tizen uses a webkit prefixed Version of indexedDB. If using a compound index, you cannot retrieve data:

{ name: "indexName", keyPath: ["locale", "order"], options: {unique: false} }

var index = app.db.transaction("STORE").objectStore("STORE").index("indexName");       
index.openCursor( IDBKeyRange.only(["en","something"]) ).onsuccess = function(event) {
    var cursor = event.target.result;
    alert(cursor);
}

never gets a result. The entry IS in the database and you get an IDB Exception 5. You can work around this issue by not using the compound index and instead receive all entries with a specific "locale" and iterate over them until you get  the wanted "order". This is inefficient if the database grows.

Testet in current emulator.

响应

1 回复
Raghavendra Reddy Shiva

Below is the issue already reported on IndexedDB. Yet to hear from the concerned team on the resolution.

https://bugs.tizen.org/jira/browse/TDIST-418