Web Developer
Hi everyone! I am a beginner with Appwrite and trying to use the CLI, but I'm stuck with a syntax error. Any guidance would be greatly appreciated! 🙏
Environment:
- Appwrite CLI: v18.2.0
- Appwrite Cloud (sgp region)
- OS: macOS 26.4 (Apple M5) / Bash
My Goal & Journey:
I want to fetch the latest few records from my memory collection.
When I ran the list-documents command without any options, I only got the default 25 records out of 38. So, I figured I needed to use --queries with limit or orderDesc, but I keep hitting a Syntax error.
What I tried:
I tried formatting the queries in a few different ways, but none of them worked in my Bash terminal:
-
JSON array format ->
Invalid query method:
appwrite databases list-documents --database-id [ID] --collection-id memory --queries '["limit(100)"]' --json -
String format ->
Invalid query: Syntax error
appwrite databases list-documents --database-id [ID] --collection-id memory --queries 'limit(100)' --json -
Escaping parentheses ->
Invalid query: Syntax error
appwrite databases list-documents --database-id [ID] --collection-id memory --queries limit\(100\) --json
My Questions:
- What is the exact syntax/escaping required for the
--queriesparameter in Bash to get the latest rows? - Where can I find the official documentation for this? I checked the CLI Commands page (https://appwrite.io/docs/tooling/command-line/commands), but I couldn't find the
list-documentssubcommand listed there.
Thank you in advance for your time!