VARIANT_OBJECT

A set of key-value pairs with STRING type keys and VARIANT type values. VARIANT_OBJECT is created when parsing Json objects (see JSON).

Accessing elements

Data elements can be accessed by the key. The variant object vo VARIANT_OBJECT({a:1, b:"text", c:{foo:2.3}} elements can be accessed:

vo[a]        // => 1
vo[b]        // => "text"
vo[c][foo]   // => 2.3

Example

1
2
3
4
dual
| select(vo:VARIANT_OBJECT({a:1, b:"text", c:{foo:2.3}}))
| select(a:vo[a], b:vo[b], foo:vo[c][foo])
;
a b foo
1 text 2.3

Converting

1
VARIANT_OBJECT(expr)
  1. converts any type of argument to VARIANT_OBJECT

Parsing

1
JSON:fieldname