#[AppwriteException: Invalid query: Attribute not found in schema: MRP]

12 messages · Page 1 of 1 (latest)

ripe spoke
#

Using AppWrite Cloud & Im facing issues when running Queries in collection.
Actually,the queries is running perfectly fine in my old colelctions and I've tested all queries function on them but In New Collections,i am getting an error while querying even fetching & creating the data is working well on new collections but unable to do query

Like if I run query ::
Query.equal('Name', 'Coca Cola')

getting an error ::
ERROR Error fetching city data: [AppwriteException: Invalid query: Attribute not found in schema: Name]

While I've attribute named Name in my collection.
Ive tested all queries function in these new collections but none of them is working.

#

See, fetching whole data is working well but unable to use Query in new collections...I've created 3 new collections and none of them is working fine with Query

upbeat grove
ripe spoke
wispy bay
#

Hey 👋 Very weird, Ill try to reproduce it quickly on my end

#
  1. Create database main
  2. Create collection profiles
  3. Add attribute Name, string length=255, required
  4. Add key index for Name attribute
  5. Add 2 documents with different names
  6. In settings give read permission to Any
  7. Send request with query

Seems to work fine on my end. Can you please confirm these steps result in error for you?

#

Wild idea, it might be backend cache issue. To test that ,can you please try to rename your database and collection? Random name, save, then back to original name, save.
That forces cache to cleared. If it starts working fine after that, we know it's issue on cache layer

ripe spoke
#

1.In my database data-level-1
2.Created collection profiles
3.Added attribute Name
4.Added key index
5.Added 2 documents
6.Gave permission
7.Query is working fine [ getting expected result ]

***BUT *this I know and the same method I'm using on different collections as well & they're working well

See my colections
https://discord.com/34943382-3675-4669-9e2f-5e4317adea49


I am facing Query issue in the collection PRDB
Yes,I created another collection with same data but still error persists.

See,I've attached the PRDB collections.

Fetching whole data is working fine
const databases = new Databases(client);` const response = await databases.listDocuments('data-level-1', 'PRDB'); console.log(response);

But,with Query it is giving an error.

ERROR:: ERROR Error fetching city data: [AppwriteException: Invalid query: Attribute not found in schema: Name]

CODE ::

        const response = await databases.listDocuments('data-level-1', 'PRDB', 
       ** [Query.equal('Name','Coca Cola')]**
        );
        console.log(response);`
``
#

Also,getting an error on creating index in Name attribute

wispy bay
#

Did you at any point delete collection, and created collection with same custom ID?

ripe spoke
#

I'm unabe to figure out the main cause of this issue.
What I tried till now?
1.Changed Collection Name
2.Re-Created the collection with same attributes / data