I know that queries on relations are not supported. But u can select some attributes of a related collection like this
[Query.select([ "$id", "name", "articles.name", "articles.description"])],
This returns me specified attributes but if I add article.$id it doesnt work. It only works if select only article.$id.
Is there any way or workaround to fetch id AND some attributes?
#Select related collection attributes and id
7 messages · Page 1 of 1 (latest)
Could you share the relationship and your collection structure?
You cannot select items on a relationship. I think if you do use the select attribute you can't even select the relationship attribute at all.
but it works
[Query.select([ "$id", "name", "articles.name", "articles.description"])] this code succeffully return articles name and description. but if i add id like this
[Query.select([ "$id", "name", "articles.name", "articles.description", "articles.$id"])] results are the same. but if there is only id selected like this [Query.select([ "$id", "name", "articles.$id"])] id is present
2 way relation. one to many
also, collectionId and databaseId seems to be always present in relation
Yes, I experienced that. But you should know that Appwrite relationships are still in beta.
How about setting a separate ID attribute for each article?