Skip to content
Back

How to use Operator.arrayAppend on a relationship

  • 0
  • Self Hosted
  • Flutter
  • Databases
Nox
8 May, 2026, 19:45

Hi, is it possible to use any operator on a relationship column? I have a One to Many relationship column on a table and I would like to add entries to the column using the arrayAppend Operator. I'm hosting Appwrite 1.9.0 and using Flutter/Dart SDK. The following snippet:

TypeScript
await databases.updateRow(
        databaseId: AppwriteConstants.databaseID,
        tableId: AppwriteConstants.tableID,
        rowId: id,
        data: {
          "related": Operator.arrayAppend([id])
        }
      );

Fails with the error relationship_value_invalid Thank you!

TL;DR
To use Operator.arrayAppend on a relationship, fetch the current row, retrieve existing relationship IDs, manually append the new ID, and then update the entire relationship field. Currently, relationship columns do not support operators so this manual process is necessary. The user has created an Enhancement issue for this on GitHub.
Devika
14 May, 2026, 16:11

As per what I've concluded from my search, relationship columns currently don't support operators. And in order to make any new updates, you should follow these steps:

  1. Fetch the current row
  2. Get existing relationship IDs
  3. Append the new ID manually
  4. Update the entire relationship field again
Nox
17 May, 2026, 18:38

Yeah that's the workflow I am following right now. I was wondering if operators support was planned on relationship columns

Nox
19 May, 2026, 19:50

I've created the following Enhancement issue: https://github.com/appwrite/appwrite/issues/12354

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