Back

[SOLVED] How to build queries with appwrite cli

  • 0
  • Tools
  • General
Ernest
10 Nov, 2023, 17:52

Please can anyone help with the format by which --queries arguments are constructed with appwrite cli would be greatly appreciated. The only hint I found while searching is this issue https://github.com/appwrite/appwrite/issues/2875 but it following the example didn't work . Keep getting the following error when I tried emulating the example from the issue.

TypeScript
 appwrite users list --queries="query.equal('phone','+123456789')"

Error Invalid queries param: Invalid query: Invalid query method

TL;DR
Solution: To build queries with appwrite cli, you can use the `--queries` argument followed by the query you want to execute. For example: `appwrite users list --queries "equal('phone','+123456789')"`. This will return the fields that match the given query. If you're encountering an error like "Invalid `queries` param: Invalid query: Invalid query method", double-check your syntax and make sure it aligns with the appwrite documentation.
Drake
10 Nov, 2023, 19:36

Can you try:

TypeScript
appwrite users list --queries "equal('phone','+123456789')"
Ernest
11 Nov, 2023, 08:07

It worked! As a follow up question can the fields returned from the queries be filtered? As always, thank you @Steven

Ernest
11 Nov, 2023, 08:08

I'm marking this post as solved since the original question has been answered

Ernest
11 Nov, 2023, 08:08

[SOLVED] How to build queries with appwrite cli

Drake
11 Nov, 2023, 16:04
Ernest
12 Nov, 2023, 15:03

Noted, thank you

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