Push new value to an existing storage object in ionic


#1

I’d like to add/push a new value to an existing storage object in Ionic 3.

Is there a specific update storage function or do i have to make it myself ?

Regards

Frank


#2

What is a “storage object”? What kind of storage? What library?


#3

Referring to this page https://ionicframework.com/docs/storage/


#4

Read the object, update the object, write the object.
If you do that more often, it makes sense to write a little wrapper function - the library only offers get and set.


#6

I wonder why i don’t use a webservice with an update sql request instead making a storage function


#7

I can’t answer that, but these things solve totally different problems: local storage vs. remote storage. Also key-value store vs. relational database.


#8

Is Ionic 3 storage keep data after the application restart on devices ?
Should i use the cordova-sqlite-storage plugin to persist data after restarting an app ?


#9

Yes, it will keep your data unless you delete all the local data from device setting (in case of Android only).
I’ve not used it recently but if I recall correctly then Yes your data will persist.


#10

Thank you for your answers