console.log(db); //db object exists
console.log(db.objectStoreNames.contains('test')); //true - object store exists
var transaction = db.transaction(['test'], 'readwrite'); // this line is causing the error
A mutation operation was attempted on a database that did not allow mutations." code: "6
Why am i getting this error? My db and objectstore exists? I'm loosing my mind! :D Any help is much appreciated!
Thanks
One potential cause of this error: Firefox does not support IndexedDB in private browsing windows. See https://bugzilla.mozilla.org/show_bug.cgi?id=1639542 and https://github.com/jakearchibald/idb/issues/81.
I just try now on chrome, safari on Mac os x and found no error.
I do as follow on http://dev.yathit.com/ydn-db/using/schema.html (the page load ydn.db.Storage object)
schema = {stores: [{name: 'test'}]}
st = new ydn.db.Storage('test1', schema)
// ... wait for async
db = st.db()
db.transaction(['test'], 'readwrite')
old chrome use 1 instead 'readwrite', but i don't think it a reason.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With