Skip to content
Blog

Struct Functions

Structs are commonly known as dictionaries 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'