#[CLOSED] How to upload a new element for specific Attribute

6 messages · Page 1 of 1 (latest)

rain hill
#

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'].

rain hill
#

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

robust swallow