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
- Apple OAuth Scopes
Hi Hi, I've configured sign in with apple and this is the response i'm getting from apple once i've signed in. I cant find anywhere I set scopes. I remember se...
- Sign In With Apple OAuth Help
Hi All! I've got a flutter & appwrite app which Im trying to use sign in with apple for. I already have sign in with google working and the function is the sam...
- Type Mismatch in AppwriteException
There is a discrepancy in the TypeScript type definitions for AppwriteException. The response property is defined as a string in the type definitions, but in pr...