Back

Query.equals - boolean value check

  • 0
  • Self Hosted
  • Databases
  • Web
discorrrdbomba
4 Feb, 2025, 06:20

I'd like to check for boolean values, for example like this:

TypeScript
        databaseId,
        userCollectionId,
        [
          Query.and([
            Query.equal("user_id", user.$id),
            Query.equal("deleted", [false]),
          ]),
        ]
      );```
I've found a matching support thread here, which showed that it works to just put in the value without any bracket and not as string, as far as i understood. But I am wondering if this the correct way, like if it would be mentioned in the docs, what would be written there? I'm unsure since chatGpt mentioned that Appwrite also uses this notation: ```[false]```
TL;DR
You can check for boolean values by inputting them without brackets or strings, like `Query.equal("deleted", false)`. While it may not be explicitly mentioned in the docs, this notation works fine as observed with Appwrite.
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