-
Notifications
You must be signed in to change notification settings - Fork 4.4k
🚀 Feature: Improving the Select Query #5376
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Thank you for opening this |
Another odd thing: Given: {
"$id": "64542e0a4656d6d829d5",
"$createdAt": "2023-05-04T22:13:30.299+00:00",
"$updatedAt": "2023-05-04T22:13:30.299+00:00",
"$permissions": [
"read(\"user:joe\")",
"update(\"user:joe\")",
"delete(\"user:joe\")"
],
"answerChoice": {
"value": "A",
"text": "Facebook",
"$id": "64542d132dbfa638c95f",
"$createdAt": "2023-05-04T22:09:23.207+00:00",
"$updatedAt": "2023-05-04T22:09:23.207+00:00",
"$permissions": [],
"question": {
"text": "Who created Flutter?",
"$id": "64542d132d90428be1d5",
"$createdAt": "2023-05-04T22:09:23.207+00:00",
"$updatedAt": "2023-05-04T22:09:23.411+00:00",
"$permissions": [],
"$databaseId": "default",
"$collectionId": "questions"
},
"correctAnswer": null,
"$databaseId": "default",
"$collectionId": "answer-choices"
},
"$databaseId": "default",
"$collectionId": "answers"
} a select query like:
should return something like: {
"answerChoice": {
"value": "A",
"text": "Facebook",
"question": {
"text": "Who created Flutter?"
}
}
} but it returns: {
"$id": "64542e0a4656d6d829d5",
"$createdAt": "2023-05-04T22:13:30.299+00:00",
"$updatedAt": "2023-05-04T22:13:30.299+00:00",
"$permissions": [
"read(\"user:joe\")",
"update(\"user:joe\")",
"delete(\"user:joe\")"
],
"answerChoice": {
"value": "A",
"text": "Facebook",
"$id": "64542d132dbfa638c95f",
"$createdAt": "2023-05-04T22:09:23.207+00:00",
"$updatedAt": "2023-05-04T22:09:23.207+00:00",
"$permissions": [],
"$databaseId": "default",
"$collectionId": "answer-choices"
},
"$databaseId": "default",
"$collectionId": "answers"
} |
I think the load of the other default fields is still set to be returned when there is a specific select https://github.com/utopia-php/database/blob/main/src/Database/Adapter/MariaDB.php#L1190 |
Currently, with maybe Query.unselect([])? I don't know how hard this would be on the backend side |
Uh oh!
There was an error while loading. Please reload this page.
👟 Reproduction steps
Sample code:
The payload code of this is this:

Please observe that in our data key with the index of 6 namely language key. It provide all the attributes of our language object/document. Now trying to query by using the new Queries
Query.select(['language.\$id'])
though the new queries is not yet supported in Appwrite 1.3 version, hence it is expected it gives me an error output. But if I use only thisQuery.select([])
. The whole code:The payload output of the code:
Please observe on the encircle of the attach picture above. It is weird right? it only provide the language ID, though the Query select is not yet available on current version of Appwrite.
👍 Expected behavior
If we use this query
Query.select(['language.\$id'])
the output should provide only the language ID in our language payload.👎 Actual Behavior
But I understand, this query is not available yet, But its weird that by using this
Query.select([])
it successfully give me the only$id
attribute of language.📝 Tasks
select()
select(["relationshipA.*"])
should only returnrelationshipA
attributes and no other relationship on the same document. See 🐛 Bug Report: Query.select() fails on querying relationships #5657select(["relationshipA.attribute"])
should return that relationship's attribute and no other relationship's attribute. See 🐛 Bug Report: Query.select() fails on querying relationships #5657🎲 Appwrite version
Version 1.3.x
💻 Operating system
Windows
🧱 Your Environment
No response
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: