bool

Boolean type

bool OR bool

Logical disjunction.

bool AND bool

Logical conjunction.

NOT bool

Logical negation.

= != ?= ?!= < > <= >=

Comparison operators

all()

Generalized boolean AND applied to the set of values.

any()

Generalized boolean OR applied to the set of values.

type
bool
bool

A boolean type with possible values of true and false.

EdgeQL has case-insensitive keywords and that includes the boolean literals:

Copy
db> 
SELECT (True, true, TRUE);
{(true, true, true)}
Copy
db> 
SELECT (False, false, FALSE);
{(false, false, false)}

A boolean value may arise as a result of a logical or comparison operations as well as IN and NOT IN:

Copy
db> 
SELECT true AND 2 < 3;
{true}
Copy
db> 
SELECT '!' IN {'hello', 'world'};
{false}

It is also possible to cast between bool, str, and json:

Copy
db> 
SELECT <json>true;
{'true'}
Copy
db> 
SELECT <bool>'True';
{true}

Filter clauses must always evaluate to a boolean:

Copy
SELECT User
FILTER .name ILIKE 'alice';
operator
bool OR bool
bool OR bool -> bool

Logical disjunction.

Copy
db> 
SELECT false OR true;
{true}
operator
bool AND bool
bool AND bool -> bool

Logical conjunction.

Copy
db> 
SELECT false AND true;
{false}
operator
NOT bool
NOT bool -> bool

Logical negation.

Copy
db> 
SELECT NOT false;
{true}

The AND and OR operators are commutative.

The truth tables are as follows:

a

b

a AND b

a OR b

NOT a

true

true

true

true

false

true

false

false

true

false

false

true

false

true

true

false

false

false

false

true

Light
Dark
System