
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
- Network error when attempting to fetch r...
Hi, I am trying to modify some database data in the console for testing but keep getting this error. I am on the appwrite cloud and have already tried clearing ...
- Having errors migrating to cloud
Project will not migrate compeltely
- Appwrite realtime stopped working all of...
In our production environment, Appwrite Realtime suddenly stopped working and no updates are coming through , can you confirm if there are any known issues?
