Skip to content
Back

How to add new child document to parent document with Flutter SDK?

  • 0
  • Flutter
Mingu
18 Dec, 2024, 09:44

I have a parent document, I want to add new child document to the parent document, but by using updateDocument, the new child will replace the old child in the parent document. In console, there is an Add Item button to add new child, which seem to work like what I wanted, so I assume this is possible. But I don't know how to, in the docs, there is no reference about it: https://appwrite.io/docs/products/databases/relationships#update

TL;DR
Developers want to add a new child document to a parent document using Flutter SDK. Using `updateDocument` replaces the old child with the new one, but they want to add the new child without replacing the old one. They noticed an 'Add Item' button in the console that accomplishes this. The solution is to use arrayUnion to add a new child document to the parent document without replacing the old child.
Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more