This request is to be able to use the data store with complex objects. For example, I would like to be able to update a single entry in the data store, with new values. Using the structure shown above, I may want to add a phone number to the phones array, or update a single phone number.
Let’s use the example of a recipe. A recipe has a name, prep time, etc. It then has an array of steps, and an array of notes (and I am using different array variables to store them.) It also has a list of ingredients, and those ingredients each have an array of nutritional values. I’ll stop there, but there are more things.
So when editing a recipe, all of the values might become “dirty” before saving. I need to be able to delete a note, add a step, add an ingredient with all its nutrients, etc., all before actually saving to the database.
It would be great to have a single data store that holds a list of recipes for searching, listing, etc. and then a data detail that is the current record being viewed, edited. If I take it all the way to the end, I’d like to be able to POST that data detail to server connect for processing, but today, I have a bunch of inputs either hidden or displayed that send this off to server connect. Keeping track of all the arrays with index references, etc. becomes mind boggling.
To not reload all data on live refresh with sockets, I was planning to insert all data from the server connect on page load, and then add a record from each socket event. In the data I require nested arrays…