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'].
for example in firebase
they have arrayUnion method does appwrite have something like this?
firebase.firestore() .collection('proprietary') .doc(docID) .set( { sharedWith: [{ who: "third@test.com", 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
[CLOSED] How to upload a new element for specific Attribute
Recommended threads
- [FEAT REQ] Bun runtime support
Instead of just Nodejs, it would be helpful to also add support for the Bun runtime which can speed up deployments by a ton.
- [ENHANCEMENT] Use the custom Next.js dep...
Deployment adapters on Next.js are now stable! This means that we don't have to stick to the limitations of sniffing out build outputs and manually moving or mo...
- NextJS builds sudden runtime_timeout
My builds suddenly stopped working. Activating old prebuilt snapshots work, but redeploying that same code produces builds that throw runtime_timeout FRA region