Skip to content
Legacy docs for Tenzir v5.x. For the latest Tenzir v6 series, visit docs.tenzir.com. Migrating from v5? Read the Tenzir v6 migration guide.

Returns a fallback value if primary is null.

otherwise(primary:any, fallback:any) -> any

The otherwise function evaluates its arguments and replaces primary with fallback where primary would be null.

The expression to return if not null.

The expression to return if primary evaluates to null.

from {x: 1}, {x: 2}, {}
x = x.otherwise(-1)
{x: 1}
{x: 2}
{x: -1}

Last updated: