githubEdit

Bool

The boolean type represents true/false values with simple, focused filter operations.

Overview

Property
Value

Go Type

bool / *bool

Database Schema

bool / option<bool>

CBOR Encoding

Direct

Sortable

Yes

Definition

type User struct {
    som.Node

    IsActive    bool   // Required
    IsAdmin     bool   // Required
    IsVerified  *bool  // Optional (nullable)
}

Schema

Generated SurrealDB schema:

Filter Operations

Value Check

Convenience Methods

Logical Inversion

Nil Operations (Pointer Types Only)

Sorting

Boolean fields sort with false before true in ascending order:

Method Chaining

Boolean filters can be inverted:

Common Patterns

Combining Boolean Filters

OR Logic with Booleans

Optional Boolean Handling

Complete Example

Filter Reference Table

Operation
Description
Returns

Is(val)

Check boolean value

Bool filter

True()

Check if true

Bool filter

False()

Check if false

Bool filter

Invert()

Logical NOT

Bool filter

IsNil()

Is null (ptr only)

Bool filter

IsNotNil()

Not null (ptr only)

Bool filter

Last updated