Dexie.js
Dexie.js copied to clipboard
Default definition for `Table.update` keypath
Hello everyone,
I frequently use the Table.update
method in my application and it's great that it supports nested keys. But what I need is some kind of standard definition if one of the nested keys do not exist. For example, when my application tries to update settings.foo.bar.abc
, but foo
does not yet exist, dexie simply does nothing.
What I need is basically some kind of mechanism, that automatically creates this object at foo
and at bar
. I can solve this with some typescript but it would be nice to have this functionality in Dexie itself.
I also thought about using Collection.modify
but I couldn't really get it working.