DataWeave 2.0

Content Length Metadata Selector (.^contentLength)

In the following Mule app flow, the Logger uses payload.^contentLength to select the length of the string my string, set…

3 years ago

Metadata Selector (.^someMetadata)

Returns the value of specified metadata for a Mule payload, variable, or attribute.

3 years ago

Filter Selectors (myKey[?($ == “aValue”)])

myKey[?($ == "aValue")] returns only the values of matching keys within an array or object. Note that ? is also…

3 years ago

Selector Modifiers (!, ?)

You can check for the presence of a given key. ! evaluates the selection and fails with an exception message…

3 years ago

Namespace Selector (#)

# returns the XML namespace of a selected key as plain text.

3 years ago

XML Attribute Selector (.@myKey)

Using .@ without the key name returns an object containing the attributes as key-value pairs.

3 years ago

Range selector (anIndex to anotherIndex)

If you need multiple sequential values from an Array, DataWeave allows you to select a range of values with the…

3 years ago

Index Selector ([])

The index selector returns the element at the specified position. It can be applied over an array, object, or string.

3 years ago

Key-Value Pair Selector (.&myKey)

The & selector acts on arrays and objects. & retrieves both the keys and values of all matching keys pairs…

3 years ago

Descendants Selector (..)

The descendants selector (..) is the perfect tool to use when you need the values for a certain key no…

3 years ago