I'm trying to query my collection filtered by a contactId. This contact id references ids of items in another collection. By the documentation something like this:
TypeScript
var documents = _databases.listDocuments(
databaseId: constants.databaseId,
collectionId: constants.CollectionIds.feedEntries,
queries: [Query.equal("contactId", contactId)]);
Should do the job fine, as the contactId attribute exists on the feedEntries collection and contactId is a String provided from other parts of the app.
But the code above throws this:
TypeScript
AppwriteException (AppwriteException: general_query_invalid, Invalid query: {"method":"equal","attribute":"contactId","values":["65fbf2e930f439e4eef7"]} (400))
What am I missing?
TL;DR
Issue: Attempting to query by equal method results in a general_query_invalid exception.
Solution: Check the data type of the 'contactId' attribute. Ensure the contactId is a string data type in both the code and the database.Recommended threads
- Can't edit envvars 'variableId is not op...
In general project settings
- Using Binary Log with Appwrite
If I can remember correctly appwrite uses mariaDB as the underlying database. If so could I use mariaDB’s binary log to see database operations from appwrite?
- 500 Internal Error on Free Plan Projects...
Hello Appwrite Support Team, I am experiencing a 500 Internal Server Error when trying to access my free plan projects in the Appwrite Cloud console. Project ...