Back

[SOLVED] How to update attribute in document

  • 0
  • Databases
  • Web
BloodThermic
16 Jun, 2023, 22:08

I have looked at docs to see how to do it but it give no info on the formating of the data so that the document knows what attribute to update https://appwrite.io/docs/client/databases?sdk=web-default#databasesUpdateDocument

TL;DR
User was initially confused about how to update an attribute in a document but eventually figured it out. They pass the attribute they want to update as part of the data parameter and treat it like creating a new document. They were unsure if they needed to specify the attribute. The solution is to pass the attribute they want to update as part of the data parameter. They also mention that there is minimal support for updating attributes in version 1.3 and ask if the user is hosting on cloud. The user mentions that they have looked at the documentation but it does not provide information on the formatting of data for updating attributes. No further solution or clarification
Drake
16 Jun, 2023, 22:09

We added minimal support for updating attributes in 1.3. Are you on cloud?

BloodThermic
16 Jun, 2023, 22:09

No self hosting

Drake
16 Jun, 2023, 22:10

Wait you want to update a document or an attribute?

BloodThermic
16 Jun, 2023, 22:11

I want to update the document data for an attribute?

BloodThermic
16 Jun, 2023, 22:11

Like WaiverIdis null and I want to update it to a collection id

BloodThermic
16 Jun, 2023, 22:11
TypeScript
      "64502243369b884d71f8",
      "647295a5228d3bd685da",
      `${test}`,
      `${result.$id}`
    );```
BloodThermic
16 Jun, 2023, 22:11

This is what I have

BloodThermic
16 Jun, 2023, 22:12

do I need to specify the attribute

Drake
16 Jun, 2023, 22:12

You pass it as part of the data parameter. Just like creating a document

Drake
16 Jun, 2023, 22:12

Of course

BloodThermic
16 Jun, 2023, 22:16

So like this const update = { WaiverId: result.$id, };

BloodThermic
16 Jun, 2023, 22:19

TY I got it! Your amazing!

BloodThermic
16 Jun, 2023, 22:19

[SOLVED] How to update attribute in document

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