【发布时间】:2015-03-31 14:50:21
【问题描述】:
在 IndexedDb 中,我有一个这样的索引:
store.createIndex('distinctEqual', 'distinctEqualString', {unique: false});
当我这样做时:
var tx = db.transaction(dbSettings.objectStore, "readwrite");
var store = tx.objectStore(dbSettings.objectStore);
var index = store.index('distinctEqual');
var reqIndex = index.get("pippo");
是否可以在不使用该 IndexedDb 索引中的光标的情况下获取所有出现的“pippo”?
编辑
如果我这样做:
var cursorIndex =
index.openKeyCursor(IDBKeyRange.only(currItem.distinctEqualString));
cursorIndex.onsuccess = function(evt) {
//Can I know how many elements are there in cursorIndex?
};
在评论中,我能知道 cursorIndex 中有多少个元素吗?
【问题讨论】:
标签: javascript jquery google-chrome indexeddb