Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

E306

For the complete documentation index optimized for AI agents, see llms.txt.

Expression is Not a Boolean

Erroneous Code Example

This error occurs when an expression is expected to result in a boolean value but produces a different type.

QUERY getUsers() =>
    users <- N<User>::WHERE(|u| u.name)
    RETURN users
N::User {
    name: String,
    active: Bool,
}

Solution

Ensure the expression evaluates to a boolean value.

QUERY getUsers() =>
    users <- N<User>::WHERE(|u| u.active == true)
    RETURN users
N::User {
    name: String,
    active: Bool,
}