View on GitHub

JODA - JSON On Demand Analysis

Efficient data wrangling for semi-structured JSON documents

TRUTHY - Type

Checks whether the given value is truthy.

Details

Truthy is defined as not falsy, where the falsy definition of MDN has been used. Equivalent to !FALSY(<x>).

Input parameters

Name Type Optional Description
x Any False  

Output

Bool: true, if value is truthy, false else

Usage

TRUTHY(<x>)

Examples

Example 1

Query

LOAD tmp
AS ('': TRUTHY(false))

Result

false

Example 2

Query

LOAD tmp
AS ('': TRUTHY(0))

Result

false

Example 3

Query

LOAD tmp
AS ('': TRUTHY(1))

Result

true

Example 4

Query

LOAD tmp
AS ('': TRUTHY(""))

Result

false

Example 5

Query

LOAD tmp
AS ('': TRUTHY("A"))

Result

true

Example 6

Query

LOAD tmp
AS ('': TRUTHY(null))

Result

false