DataWeave can select data from DataWeave objects and arrays, variables that store
that data, and the output of DataWeave functions when that output is an array or
object.
More precisely, a DataWeave selector operates within a context, which can
be a reference to the variable that stores the data, an object literal, an array
literal, or the invocation of a DataWeave function. You can use selectors in Mule
modules, connectors, and components that accept DataWeave expressions.
When DataWeave processes a selector, it sets a new context (or scope) for
subsequent selectors, so you can navigate through the complex structures
of arrays and objects using chains of selectors. The depth of the selection
is limited only by the depth of the current context.
Supported variable references are
Mule Runtime variables, such as payload
and attributes, and DataWeave variables that
store arrays or objects. A simple example is payload.myKey where the
payload is the object {"myKey" : 1234 }, so the result is 1234.
A selector can act on the invocation of a function, such as the DataWeave
read function. For example, read('{"A":"B"}','application/json')."A"
returns "B".