I'm querying a appwrite collection via the REST API on appwrite cloud 1.9.5 (no SDK) via a cloudflare worker and keep getting:
{"message":"Invalid query: Attribute not found in schema: ","code":400,"type":"general_query_invalid","version":"1.9.5"}
This was my https request: https://fra.cloud.appwrite.io/v1/databases/<DB_ID>/collections/<COLLECTION_ID>/documents?queries[]={"method":"equal","column":"userId","values":["<USER_ID>"]}.
To my understanding, it is the correct format.
I can confirm that the attribute userId exists in the collection and userId is indexed. DB ID, Collection ID, and Project ID are all correct. JWT auth is working. Fetching ALL documents with no query works fine. With a query, there is a problem.
Why do I get the Attribute not found in schema error? How can I resolve this?
Here was my code for the fetch
const query = JSON.stringify({ method: "equal", column: "userId", values: [userId], });
const userProfileResponse = await fetch(
${env.APPWRITE_ENDPOINT}/databases/${env.DB_ID}/collections/${env.USER_PROFILE_ID}/documents?queries[]=${encodeURIComponent(query)},
{
method: "GET",
headers: {
"X-Appwrite-Project": env.PROJECT_ID,
"X-Appwrite-JWT": jwt,
},
}
);
Recommended threads
- Invalid type for attribute 'email': emai...
I'm using the node-appwrite SDK to create a table, the column payload looks like this: ```json [{"key":"email","type":"email","required":true, "size": 512}] ``...
- Auth not working
guys my appwrite auth isnt working? oauth works (Sign in with google n discord) i have 2 websites deployed where do i get help when i do sign in with email and ...
- Issue related to index
Why it is showing this error?