Dexie.js icon indicating copy to clipboard operation
Dexie.js copied to clipboard

Default definition for `Table.update` keypath

Open Ari24-cb24 opened this issue 1 year ago • 0 comments

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.

Ari24-cb24 avatar Mar 25 '23 08:03 Ari24-cb24