Back

Add a value to Array in document

  • 0
  • Databases
  • Flutter
YahalomS
31 Dec, 2023, 08:57

I have a collection where one of the attributes is an Array. I want to add a value to this array, and to make it as efficient as possible The simple way would be :

  • To get the Array,
  • to add the new value to the Array
  • to update the document with the new array

but it requires 2 interactions with the database (and if I dont know the ID of the document, 3) I am trying to make it all in a single interaction: Just to add the vew value in the Array with the UpdateDocument function Is it possible?

Thanks,

TL;DR
Is it possible to add a value to an array in a document in a single interaction with the database?
YahalomS
31 Dec, 2023, 09:03

Add a value to Array in document

Drake
31 Dec, 2023, 18:07

Array operations like this aren't available yet

kamal.panara
31 Dec, 2023, 18:14

you can achieve this with the help of cloud function.

YahalomS
31 Dec, 2023, 22:21

Thank you

ideclon
1 Jan, 2024, 00:38

If your issue has been solved, you can mark this post as closed by adding “[SOLVED]” to the beginning of the title

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