我遇到的問題是IE11的代碼在Google Chrome中可用。複合索引的IE11 IDBIndex.openCursor()不會返回結果
考慮在與具有兩個字段的化合物鍵typekey對象存儲以下查詢:類型,docID的
store.createIndex("typekey", [ "type", "docID" ], { unique: false });
...
idb.transaction("inbox")
.objectStore("inbox")
.index("typekey")
.openCursor()
.onsuccess = function(e) {
debugger;
// e.target.result is null, even though there are records in the objectStore
};
使用考慮在同一個表的查詢主鍵。
idb.transaction("inbox")
.objectStore("inbox")
.openCursor()
.onsuccess = function(e) {
debugger;
// e.target.result is an IDBCursorWithValue as expected
};
爲什麼Internet Explorer在第一個實例中不返回任何結果?
多項索引和複合索引不是同一回事。但是,IE不支持這兩種功能。 – dumbmatter 2014-11-01 03:29:22
我不使用multiEntry,也指定一個數組(字符串序列)和multiEntry:根據規範,true是非法的。 「如果keyPath是一個序列,並且optionalParameters中的multiEntry屬性爲true,那麼實現必須拋出一個類型爲InvalidAccessError的DOMException。」 –
2014-11-03 12:36:36
dumbmatter如果您將您的評論添加爲答案,我可以將此問題標記爲已回答 – 2014-11-07 14:28:55