Skip to content
Back

Update string attribute

  • 0
  • Databases
  • Functions
  • General
max_coleman
9 Dec, 2025, 19:47

Hi, Unsure if we’re able to use newKey when updating string attribute over node.js server api call to change an attribute name instead of having to create a new one and delete old.

Everything online is saying no but the docs have it in there

TL;DR
Developers are advised to use the new object style param when updating string attributes. Make sure to format code properly in backticks for better readability. The console can be used to inspect network traffic to understand API calls. The possibility of renaming a key is confirmed by the developers.
Steven
10 Dec, 2025, 05:47

Yes, you can rename the key

max_coleman
10 Dec, 2025, 12:00

i am trying to do this over a appwrite function rather than in the console, but when i pass size and newKey they are not being updated using the example doc the only thing changing is the default value; example: const result = await databases.updateStringAttribute( databaseId, collectionId, 'title1', false, 'new', 100, // optional 'titleone' // optional ); log(databases.updateStringAttribute.toString()); ' async updateStringAttribute(databaseId, collectionId, key, required, xdefault)'

Steven
10 Dec, 2025, 18:05

The console makes the same API calls. So you can always inspect the network traffic to see what it's doing

Steven
10 Dec, 2025, 18:06

FYI, it's best to wrap code in backticks to format a bit nicer. You can use 1 backtick for inline code (https://www.markdownguide.org/basic-syntax/#code) and 3 backticks for multiline code (https://www.markdownguide.org/extended-syntax/#syntax-highlighting).

Steven
10 Dec, 2025, 18:07

Uh I don't think that's the right syntax for logging. Also, that method is deprecated. You should use the new object style param

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