'typeorm QueryBuilder: how to match column value of boolean?

In Typeorm Query Builder, what is the syntax like when I want to match rows whose value is equal to a boolean of True?

For example, I have this working code:

  await getConnection()
      .createQueryBuilder()
      .delete()
      .from(Notification)
      .where("id = :id", { id: 1 })
      .andWhere('dstOrgId = :dstOrgId', { dstOrgId: 1001 })
      .execute();

However, if I want to match all rows whose clicked column has a value of boolean True, how should I write it?

I want to do something like:

  await getConnection()
      .createQueryBuilder()
      .delete()
      .from(Notification)
      .where("clicked = :x", { x: true })
      .andWhere("viewed = :x", { x: false })
      .execute();

But this above code does not seem to be in nice syntax, or "proper" syntax



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source