![](https://cdn.discordapp.com/avatars/383094359446388747/9c8ddba08b0fd464c433237e41b0a258.webp)
I created a function that receives the id of a product and returns its data if it is active in the database. I am having problems setting up the Query to query the documents using the list_documents method. I would like help in setting up the Query for this search. I'm sending an image of my code to the function and I'm using the following versions:
Python == 3.11 Appwrite == Version 1.4.13
![](https://cdn.discordapp.com/avatars/383094359446388747/9c8ddba08b0fd464c433237e41b0a258.webp)
Error:
Traceback (most recent call last):
File "/usr/local/server/src/function/runtime-env/lib/python3.11/site-packages/appwrite/client.py", line 114, in call
response.raise_for_status()
File "/usr/local/server/src/function/runtime-env/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Internal Server Error for url: http://appwrite-url/v1/databases/db_store/collections/products/documents?queries%5B0%5D=%7B%22method%22%3A%22equal%22%2C%22attribute%22%3A%22%24id%22%2C%22values%22%3A%5B%22661850d8d17fa591335b%22%5D%7D
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/server/src/server.py", line 163, in action
output = await asyncio.wait_for(execute(context), timeout=safeTimeout)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/asyncio/tasks.py", line 489, in wait_for
return fut.result()
^^^^^^^^^^^^
File "/usr/local/server/src/server.py", line 156, in execute
output = userModule.main(context)
^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/server/src/function/src/main.py", line 39, in main
search_product = databases.list_documents(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/server/src/function/runtime-env/lib/python3.11/site-packages/appwrite/services/databases.py", line 916, in list_documents
return self.client.call('get', api_path, {
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/server/src/function/runtime-env/lib/python3.11/site-packages/appwrite/client.py", line 129, in call
raise AppwriteException(response.json()['message'], response.status_code, response.json().get('type'), response.json())
appwrite.exception.AppwriteException: Server Error
![](https://cdn.discordapp.com/avatars/796164927034359808/318b9f408f57114c9605b8d3b30fd499.webp)
Double check that you're using the correct SDK version for your version of Appwrite.
Recommended threads
- Attribute Limit Exceeded - Again ;-)
Hi @all, I migrated a table with around 50 attributes from MySQL to Supabase and like to migrate that to appwrite now. My freelancer managed to create that col...
- Scheduled cloud function
As I understood it is possible to create a function execution from the server sdk with an ISO date as the time. Am I wrong to assume that this will execute the ...
- (Self-Hosted) Dart function deployment b...
Hello everyone, I am currently trying to deploy a dart function on my Appwrite instance (v1.5.7). Due to the need of a corporate certificate to download depende...
![](/images/bgs/pre-footer.png)