Thanks for including your error. I can't say with certainty without seeing your object store creation code but I'm very familiar with this type of issue.
What it means is that you're not using auto-incrementing keys, and providing a key yourself. That's very normal. In that case, you use the following IDBCursor.update()
signature.
cursor.update(your_updated_entry_object);
IDB knows which entry to update because your key is "in-line" on the your_updated_entry_object
(meaning your_updated_entry_object
has an attribute that is your key).
It sounds like you may have seen the IDBStore.put()
method and been confused. That takes on two seperate signatures for so-called "inline keys" (what you have) and "out-of-line" keys (what you get if you let IDB autoincrement the keys for you).
With in-line keys, it's the same signature as IDBCursor.update()
:
store.put(your_updated_entry_object);
However with out-of-line keys, it takes on an extra key
param that tells IDB which object to update (since you're not on a cursor and otherwise has no context for your request):
store.put(your-updated_entry_object, your_autoincremented_key);