Skip to content
Blog

Struct Functions

STRUCTs are commonly known as dictionaries, mappings or key-value pairs. The key is a STRING and the value can be any data type. The following table lists the operators that can be used with STRUCTs. The following operators work on STRUCTs:

OperatorDescriptionExampleResult
{key:value,}creates a struct of key-value pairs{name: 'Alice', age: 20}{NAME: Alice, AGE: 20}
struct.field_namealias of struct_extract{name: 'Alice', age: 20}.name'Alice'

The functions that can be used with structs are as follows:

FunctionDescriptionExampleResult
struct_extract(struct, 'field_name')extracts named field from structstruct_extract({name: 'Alice', age: 20}, 'name')'Alice'