[AppwriteException: Invalid query: Attribute not found in schema: MRP]
- 1
- Databases
- Realtime
- Cloud
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
The attribute name was created recently?
3 hours ago
Hey 👋 Very weird, Ill try to reproduce it quickly on my end
- Create database
main
- Create collection
profiles
- Add attribute
Name
, string length=255, required - Add
key
index forName
attribute - Add 2 documents with different names
- In settings give
read
permission toAny
- 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
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
Did you at any point delete collection, and created collection with same custom ID?
No
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
recreating the collection should have solved things...so the problem now is failed index?
Recommended threads
- Need help with createExecution function
Hi, Need some help understanding createExecution. When requesting function execution via createExecution, the function handler arguments are incorrect and rese...
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Need Help with Google OAuth2 in Expo usi...
I'm learning React Native with Expo and trying to set up Google OAuth2 with Appwrite. I couldn't find any good docs or tutorials for this and my own attempt did...