i am using flutter sdk (appwrite: ^8.2.2) and cloud appwrite. When i am try to query getting an error -: Index not found: user_id
user_id is the attribute in my db.
My code is below
await databases.listDocuments( databaseId: AppWriteConstants.databaseId, collectionId: AppWriteConstants.colProjectUserRole, queries: [ Query.equal('user_id', prefs.getString(PreferenceType.userId) ?? ''), ], )
You must create an index of your attribute in order to use it in a query.
Ref: https://appwrite.io/docs/databases#indexes Also see this post by VicentGe https://dev.to/appwrite/how-do-i-index-my-appwrite-collection-2o4n
Thank you @Ponguta_ . It solve the issue.
Recommended threads
- Relation Question
How do I create a relation from table y to an others x.$id. in my example I have a users table where I use Appwrites unique User IDs and I want other tables fo...
- Unknown attribute type: varchar / text
Since the `string` type is deprecated I tried using `varchar` and `text` in some newer tables, but when running `appwrite pull tables && appwrite types ./src/li...
- I'm experiencing a critical bug on Appwr...
Hey <@870607367597850624> team / support 👋 I'm experiencing a critical bug on Appwrite Cloud that's blocking my production Flutter app. I've already filed GitH...