In this application that I am developing for a friend, one of the main features is to be able to add the attendance of each of his students to the database.
The main thing in the database is always to have a good structure to be able to facilitate this type of processes. And in this case, within the table that manages the dates, there is a row that is responsible for saving the history of each student.
It is only mentioned to save the date that the student attended only so that I use a matrix to which I insert new data. And so my friend can keep a record without any problem of each student who attends his classes.
It must be taken into account that the database is made in Firebase and to insert new data into that existing array what I must do is first clone it and add the new data to that copy in the computer's memory and then replace it with the previously existing one. It sounds a bit confusing and far-fetched but it is functional from the application side.
The incredible thing is that all these changes are made in real time and therefore my friend will be able to see in his database that the new date has been assigned correctly and when refreshing the list of students he will also be able to see the dates added to each particular student.