
Hi, I'm trying to retrieve character documents which have an attribute "userId" from a query, but the response is always an empty document.
const response = await databases.listDocuments(
process.env.APPWRITE_DATABASE_ID,
process.env.APPWRITE_CHARACTER_COLLECTION_ID,
[
Query.equal('userId', userId),
// Query.select(["characterId"])
]
)
if (response && response.documents) {
log(response)
return {
success: true,
response,
total: response.total
};
} else {
return {
success: false,
message: "Received response in unexpected format",
data: response
};
}
Here are some things I've checked - ✅ Document exists with correct userId. ✅ Collection has permission for all users. ✅ collection has an attribute named userId which is also made an index. ✅ function executes, payload is recieved correctly.
Any help is appreciated.
Recommended threads
- Account Deletion is not working
Hey There, i am trying to trigger a function with a swift ui button. The function ist to delete the currently active user with the userID, so that the account i...
- OAuth2 Giving 404
I am trying to implement oauth2 with Google, but it keeps giving this weird 404 error.
- Safe Approach to Bucket
Hello, This is my utility function for obtaining the users' avatar url. Is this a safe approach to the problem? I am also unsure about ending the url with `&mod...
