Mr. Bakbuki
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
- How to Avoid Double Requests in function...
I'm currently using Appwrite's `functions.createExecution` in my project. I want to avoid double requests when multiple actions (like searching or pagination) a...
- Send Email Verification With REST
I am using REST to create a user on the server side after receiving form data from the client. After the account is successfully created i wanted to send the v...
- Use different email hosts for different ...
Hello, I have 2 projects and i want to be able to set up email templates in the projects. Both projects will have different email host configurations. I see ...