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
- Function connected custom domain error: ...
My domain is served through Cloudflare. Domain is now connected with the appwrite function. But when accessing the domain, I get the below error. Any suggestion...
- Error | general_unknown
I have built a website using Appwrite Cloud as backend, and also using sites for deployment. My website is live but sometimes it shows Appwrite's Error general_...
- Invalid token passed in the request
Hello, I have an issue using updateMagicURLSession. I send the email using sendMagicLink, which works fine. When i click the link in the email i get the invali...