We do know that we can set the value for this attribute can be an array. In instance, we have List of String with the name of followers, and then currently in this specific document it have this value ['Mosh','Josh']. Now what if in client side I want to add another element we can call it 'Tosh' as a new followers. So what function or how can we do this to upload this new element? Hence, if we successuly update the document then the followers' attribute we will have ['Mosh','Josh','Tosh'].
#[CLOSED] How to upload a new element for specific Attribute
6 messages · Page 1 of 1 (latest)
for example in firebase
they have arrayUnion method does appwrite have something like this?
firebase.firestore()
.collection('proprietary')
.doc(docID)
.set(
{ sharedWith: [{ who: "[email protected]", when: new Date() }] },
{ merge: true }
)
or something like merge
we don't have any array operations yet. You might want to 👍🏼 this issue: https://github.com/appwrite/appwrite/issues/2531
For now, you'll have to replace the attribute with the full updated value