Jak*_*rew 10 javascript indexeddb
我已经看到createIndex了在创建ObjectStore之后直接定义ObjectStore索引的多个JavaScript示例,如下所示:
var objectStore = ixDb.createObjectStore(osName, { keyPath: pkName, autoIncrement: autoIncrement });
objectStore.createIndex("name", "name", { unique: false });
Run Code Online (Sandbox Code Playgroud)
任何人都可以告诉我如何createIndex在没有调用的情况下使用预先存在的表createObjectStore吗?我想这里真正的问题是如何在不使用的情况下获取对objectStore的引用createObjectStore?
我尝试了以下几种变体而没有运气:
var objectStore = window.IDBTransaction.objectStore(ObjectStoreName);
var index = objectStore.createIndex(ixName, fieldName, { unique: unique, multiEntry: multiEntry });
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
5295 次 |
| 最近记录: |