Invalid query: Attribute not found in schema even though query, and attribute are correct/exist.
- 0
- 2
- Self Hosted
- Databases
- REST API
Hiya. I'm trying to use the REST API with documents and doing a simple select with query:
https://<mydomain>/v1/databases/<database>/collections/<collection>/documents?queries[]=%7B%22method%22%3A%22equal%22%2C%22column%22%3A%22uuid%22%2C%22values%22%3A%5B%22abcdefg%22%5D%7D
({"method":"equal","column":"uuid","values":["abcdefg"]})
and getting
"message": "Invalid query: Attribute not found in schema: ",
"code": 400,
"type": "general_query_invalid",
"version": "1.6.0",
"file": "/usr/src/code/app/controllers/api/databases.php",
"line": 3099,
"trace":
even though the attribute definitely does exist. Could this be an installation error on my part, perhaps? Thanks for the help
Or maybe I'm misunderstanding how to use the query argument. First time using it.
I can help with that this error usually happens when the field name in your query doesn’t exactly match the attribute name in your collection schema (case-sensitive) or if the document schema hasn’t been updated after adding the field.
Did you manually create the uuid field in the dashboard or through the API?
Your query should have "attribute":"uuid" instead of "column":"uuid"
I created it through the dashboard, so not sure if that would be an issue...
Ah! That's probably it. Will try later. I was a bit confused with the naming scheme in the query document. Why does it talk about table, row and column?
Is it to generalize the doc reference?
We recently changed terminology to be more in line with the technology being used (SQL databases), but queries have not been updated yet. Often people are using the SDKs, so won't see the encoded form
Solved!
Can you send me a message
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...
- local build `composer installer:dev` iss...
setup - dev container (default linux universal) WSL (test with gh codespace too) - php 8.5.7 - all extensions installed - `composer install` fine - `composer...
- 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...