This code works fine:
TypeScript
const doc = await databases.getDocument("main", "users", account.$id, [
Query.select(["premium"]),
]);
But this code throws an error:
TypeScript
const doc = await databases.getDocument("main", "users", account.$id, [
Query.select(["premium", "albums"]),
]);
``` where "albums" is a relationship attribute
The error:
```json
{
"code": 500,
"type": "general_unknown",
"response": {
"message": "Server Error",
"code": 500,
"type": "general_unknown",
"version": "1.5.3"
}
}
And in the logs:
TypeScript
[Error] Method: GET
[Error] URL: /v1/databases/:databaseId/collections/:collectionId/documents/:documentId
[Error] Type: Utopia\Database\Exception
[Error] Message: Cannot select attributes: albums
[Error] File: /usr/src/code/vendor/utopia-php/database/src/Database/Database.php
[Error] Line: 5249
TL;DR
Error occurs when trying to fetch a document with a relationship query including the "albums" attribute. Server throws a 500 error indicating "Cannot select attributes: albums".Relationship query attribute causes server error.Recommended threads
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...
- Selfhosted starter python function retur...
I am running a selfhosted appwrite instance. Creating a node function and executing it works just fine but when i try to execute a python starter function, i ge...
- Database Write Limits hit
Hello Appwrite Admins, I'm a GitHub Education user, and about a week ago, my database was really badly optimized, resulting in about 600k writes in a single day...