In the Collection i have addressDetails as string[], basically I want to append the new address into addressDetails[]
let stringAddress=JSON.stringify(data);
this.database.updateDocument(this.DB_ID, this.USERACCOUNT_ID, '6604b6f2bd685e13bb9a', {"addressDetails": stringAddress}).then(result =>{
console.log('Address Updated');
})
also How can i edit the existing addressDetails :string[] attribute?
Or should I use new collection for Address and use relationship between UserAccount and Address Collection?
TL;DR
- Developers want to update a string[] property in a document using updateDocument.
- They are looking to append a new address to the existing addressDetails[] array.
- Unsure if updateDocument supports a Query property.
- There is a suggestion to create a new collection for Addresses and establish a relationship between UserAccount and Address Collection.
Solution: To update the existing addressDetails attribute, you can retrieve the existing array, manipulate it by adding the new address, and then update the document with the modified array.