我的基本 dexie 数据库方案是这样的。
const db = new Dexie('MyDatabase');
// Declare tables, IDs and indexes
db.version(1).stores({
myrecords: 'record_id'
});
我想使用我的 record_id
作为唯一 key 。在indexeddb中我可以像下面这样做
var myrecordsObjectStore = db.createObjectStore('myrecords' , {
keyPath: 'record_id'
});
最佳答案
关于javascript - 在 Dexie 数据库模式中指定不同的唯一键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58050976/