Table of Contents
Importance
- All the keys of Find object in find_one, find_many, update_one, …. are index names! not field names.
- Except for the Find of
idb.filter, they’re field names, not index names
- Transaction will terminate INSTANTLY on error, try/catch won’t help.
Open at App Start
// Example open with indexes, versioning is auto
// one -> single value
// one -> single value and unique
// arr -> array field
// arr_u -> array field and unique
idb.open("sobuuk",{
store1:[
"Name",one, "Age",one, ["Name","Age"],one, "Phone",one_u
]
});
Reopen and Query
var Db = idb.reopen("mydb");
var Trans = Db.transaction("mystore",RW); // or RO
await idb.insert_one(Trans,{foo:"bar"});
Db.close();