There is no method in the documentation which lets us add a single element to a document. The only way is to first get the current array and then add form a new array and send it to the database using updateDocument
method. Is there any better solution to this?
TL;DR
To add elements to an array inside a document, you will need to first retrieve the current array, then create a new array by concatenating the current array with the desired element(s), and finally use the `updateDocument` method to save the updated array to the database. There is currently no method in the documentation that allows for directly adding a single element to a document. Consequently, concatenation is the recommended approach for updating the array attribute.