jakearchibald / idb-keyval

A super-simple-small promise-based keyval store implemented with IndexedDB

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Setting and Getting nested objects (arrays)

etturD4 opened this issue · comments

EDIT: found update function

Probably a dumb question, but can I work with (set & get) parts of a nested object, if so can anyone provide a simple example?
lets say I have a object in DB like so

"12345": {
"idstring1": {
  propertyOne: 123,
  propertyTwo:456
 },
"idstring2":{
  propertyOne: 123,
  propertyTwo:456
 }
}

and now I wish to update this object ("12345") by adding "idstring3", can I do this with a set function without replacing entire object?
or am I limited to updating the object outside of DB and then replacing the entire object?

Similar question but with an array, if key-val was "12345":[{idString1:""}, {idstring2:""}] can I push/remove from this array on DB level or should I replaced entire object?