Internet explorer 复合索引的IE11 IDBIndex.openCursor()不返回任何结果
我对IE11在谷歌Chrome上的代码有问题 考虑以下对具有复合键typekey的对象存储的查询,该复合键有两个字段:type、docIDInternet explorer 复合索引的IE11 IDBIndex.openCursor()不返回任何结果,internet-explorer,indexeddb,Internet Explorer,Indexeddb,我对IE11在谷歌Chrome上的代码有问题 考虑以下对具有复合键typekey的对象存储的查询,该复合键有两个字段:type、docID store.createIndex("typekey", [ "type", "docID" ], { unique: false }); 考虑使用主键对同一个表进行查询 idb.transaction("inbox") .objectStore("inbox") .openCursor() .onsuccess = functi
store.createIndex("typekey", [ "type", "docID" ], { unique: false });
考虑使用主键对同一个表进行查询
idb.transaction("inbox")
.objectStore("inbox")
.openCursor()
.onsuccess = function(e) {
debugger;
// e.target.result is an IDBCursorWithValue as expected
};
为什么Internet Explorer在第一个实例中不返回任何结果?根据的参考页,IE不支持多条目索引 Windows开发人员论坛上有一个关于解决方法可能方向的讨论 希望这有助于
--Lance“多条目索引和复合索引不是一回事。但是,IE不支持这两种功能。”–dumbmatter 11月1日3:29 (来自下面的评论)IE的Polyfill:
…使IE与Chrome和Firefox一样,具有复合索引和多条目索引。多条目索引和复合索引不是一回事。但是,IE不支持这两种功能。我没有使用multiEntry,也没有指定数组(字符串序列),根据规范,multiEntry:true是非法的。“如果keyPath是序列,并且optionalParameters中的multiEntry属性为true,则实现必须抛出InvalidAccessError类型的DomeException。”如果你添加你的评论作为答案,我可以将这个问题标记为已回答
idb.transaction("inbox")
.objectStore("inbox")
.openCursor()
.onsuccess = function(e) {
debugger;
// e.target.result is an IDBCursorWithValue as expected
};