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
- Appwrite console is too heavy
The Appwrite console is too heavy And all of my services broken Any support , please
- Usage of the new Client() and dealing wi...
Hey guys, just a quick one - we had some web traffic the other day and it ended up bombing out - To put in perspective of how the app works, we have a Nuxt Ap...
- [Beginner] CLI --queries Syntax Error & ...
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏 **Enviro...