Back

query (and / or )

  • 0
  • Databases
showmore
22 Apr, 2023, 10:10

Hey guys, I want to understand how I can use and or inside query. here is my example

TypeScript
$database->listDocuments(
              "*****",
              "****",
               [
                    $this->q->equal("name", $name),
                    $this->q->equal("age", $age)
               ]
            ); 

its I think for and (name and age ), what about (name or age), incase age is empty. for example if i have ```[{"name":"Aron", "age": "23"}, {"name":"kebe", "age": "26"}, {"name":"josi", "age": "27"}, {"name":"abela", "age": "23"}]

TypeScript
giving Aron and 23 i want to get

[{"name":"Aron", "age": "23"}, {"name":"abela", "age": "23"}]

TypeScript
thanks
TL;DR
The user is asking if it's possible to use 'and' and 'or' operators in a query using a specific programming language. They provide an example of their code and ask for help in achieving the desired result. A response suggests that logical 'or' is not supported and directs the user to an issue on GitHub. No solution is provided in the thread.
Drake
22 Apr, 2023, 15:42

Logical OR like that isn't supported. You might want to 👍 this issue: https://github.com/appwrite/appwrite/issues/2740

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