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
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- Websites hosted on my appwrite sites hav...
Hello, all my websites hosted on appwrite sites are not running I am getting this message "This site can’t be reached drivehub.appwrite.network took too long t...
- Appwrite Auth & Function don't reveal cl...
When I execute a function or sign in with my Flutter app, Appwrite does not show my real IP: instead, it seems that Appwrite shows Fastly CDN IP address.