Back

`Flutter:` Query Example in Documention is `not accurate` as query function data type is `dynamic`

  • 0
  • Databases
Vedsaga
25 Mar, 2023, 14:00

Flutter: Query Example in Documention is not accurate as query function data type is dynamic

TL;DR
The user is experiencing an error while trying to query a collection in Flutter using the Appwrite SDK. They have created an index in the dashboard, but it shows as failed. They are getting an error message saying that the attribute is not found in the schema. They question if they should pass the index name as the attribute in the query function. They have also raised a bug on GitHub for this issue. There is no solution provided in the support thread.
Vedsaga
25 Mar, 2023, 14:04
TypeScript
 static equal(String attribute, dynamic value) =>
      _addQuery(attribute, 'equal', value);``` if I get correctly as per documentation, `attribute` refers to `index` only  right? so as in the screenshot it can be seen there is one index I created called `idx_business_user_id_business_name` so I should pass the index name right in place on `attribute` ?
Vedsaga
25 Mar, 2023, 15:58

getting error, txt "message" -> "Query not valid: Attribute not found in schema: idx_business_user_id" but index does exist in the dashboard however, index created from dashboard shows failed tagged...

Vedsaga
25 Mar, 2023, 15:58
Vedsaga
25 Mar, 2023, 15:59

I did quick search and and few asked about it earlier but, that didn't help

safwan
25 Mar, 2023, 16:10

I'm sorry but what exactly is the issue you're facing?

Vedsaga
25 Mar, 2023, 16:39

@safwan this one...

Vedsaga
25 Mar, 2023, 16:40

I tried to fetch list of documents

safwan
25 Mar, 2023, 17:44

okay what are you trying to query?

Drake
25 Mar, 2023, 23:40

That's weird. I never run into that error before. What is appWrite?

Vedsaga
26 Mar, 2023, 03:20

just normal class containing static function and final var

Vedsaga
26 Mar, 2023, 03:20

Error is coming from analyser

Vedsaga
26 Mar, 2023, 03:21

if you enable analyser you will also get... I am using very good analyser

Drake
26 Mar, 2023, 04:07

Interesting...I just use the default dart/flutter analyzer

Drake
26 Mar, 2023, 04:08

Feel free to create an issue

Vedsaga
26 Mar, 2023, 04:26

yap yap juts going to create it

Vedsaga
26 Mar, 2023, 05:44

created this bug...

Vedsaga
26 Mar, 2023, 05:45

btw Steven could you pls help with this why its failing ? I don't understand the reason behind it...

Drake
26 Mar, 2023, 06:41

If you have a failed index, you'll need to check the docker logs for the appwrite-worker-databases container to see why it failed

Drake
26 Mar, 2023, 06:41

Attribute refers to attribute, not index

Vedsaga
26 Mar, 2023, 06:41

I have redploy the business collection now it's avl

Vedsaga
26 Mar, 2023, 06:42

oh didn't didn't knew... so how do I query with index or we can't and just that index are for appwrite to query

Drake
26 Mar, 2023, 06:53

Indexes are automatically used based on the queries you pass

Vedsaga
26 Mar, 2023, 06:54

oh got it, thank you I guess that lead me some confusion... thank you again Steven I don't know how many times I said and will keep saying πŸ™

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more