Back

REST API Queries Help

  • 0
  • Web
Diego
25 Jul, 2023, 14:38

Even checking the documentation, I didn't understand how to use queries via REST API.

I'm trying to fetch a document with Id=3: /collections/GRUPO/documents?queries[select(["$id"])]="3"

This gives me the following error: "Query not valid: Query operator invalid: "

What am I doing wrong?

TL;DR
The user is seeking help with using queries in the REST API. They have provided an example of how to use queries, but they are still confused. They tried fetching a document with ID=3 but received an error message saying the query is not valid and the query operator is invalid. They are requesting assistance in what they might be doing wrong. Solution: The user should correct their query syntax. Instead of using square brackets, they should use parentheses for the query options. For example, they should try using `/collections/GRUPO/documents?queries=(select(["$id"]):"3")` to fetch the document with ID=
Binyamin
25 Jul, 2023, 14:41

Use it like so

TypeScript
queries[]=select(["$id"])&queries[]=limit(3)
Drake
25 Jul, 2023, 17:08

For more info, see the docs: https://appwrite.io/docs/rest#query

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more