Define a map or object in the same way as a JSON object. Access a map using
[]
, or access an object using dot notation. For example,
{'<key>':
<value>}
.
If the property key contains any characters other than alphanumeric characters or underscores,
you must access it using []
. Null keys are discarded.
Map or object keys can be quoted or unquoted. If an unquoted key only contains alphanumeric characters or underscores, it is considered a literal. Otherwise, it is treated as an expression or data model property reference.
If a top level root property needs to be used as a map key which doesn’t have the dot
operator, use the internal variables #root
or
#this
, as shown in the examples.
The following examples are formatted with line breaks for readability, however expressions cannot contain line breaks or new line characters.
Command | Example |
---|---|
Define a map or object |
|
Empty map or object |
{:} |
Access a map |
|
Access an object |
Note:
Object access against literals causes an error if an incorrect or missing property is accessed, as shown in the following example.
|