
Hello there,
I've a post collection and each post has a relationship with the user collection. I was trying to fetch all the posts by a particular user by using this query:
const documents = await databases.listDocuments(
DATABASE_ID,
COLLECTION_ID,
[Query.equal("user.$id","userId")]
);
But I'm getting this error:
⨯ node_modules/appwrite/dist/esm/sdk.js (428:26) @ Client.eval
⨯ AppwriteException: Invalid query: Cannot query nested attribute on: user
at Generator.next (<anonymous>)
user attribute:
{
otherPostAttributes,
user: {
$id: "123",
name: "John Doe",
}
}
I would like to know how can I achieve this? Any help is appreciated. Thanks

Querjes currently do not work on relationships
Recommended threads
- [AppwriteException: Network request fail...
When I tried to list the documents from one of the collections, it would show Error: Network request failed. But if I tried others, it would show all of the doc...
- Question about adding duplicate worker-f...
1.) Is this still this is a valid strategy for having parallel processing of async function executions? I saw some support threads on the appwrite site which we...
- How to detect user disconnection?
I'm creating a 1v1 challenge using realtime and i want to trigger a function when the user disconnect... how to make this using Appwrite Realtime? i searched i...
