NicoOriginal post
Rank 1: Thread
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:
Dart
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:
AppwriteException (AppwriteException: general_query_invalid, Invalid query: {"method":"equal","attribute":"contactId","values":["65fbf2e930f439e4eef7"]} (400))
What am I missing?
Summary
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.