coderz.py

Keep Coding Keep Cheering!

Index Selector ([])

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

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Key-Value Pair Selector (.&myKey)

The & selector acts on arrays and objects. & retrieves both the keys and values of all matching keys pairs in the current context. These are returned as an object, containing the retrieved keys and values.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Descendants Selector (..)

The descendants selector (..) is the perfect tool to use when you need the values for a certain key no matter where they appear in a piece of data.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Multi-Value Selector (.*)

The multi-value selector (.*) returns an Array containing any value that matches the key. The values returned are dependent on the key that’s passed in. The multi-value selector works on both Arrays and Objects, but in different ways.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Single-Value Selector

The single-value selector (.) allows you to lookup Object values by their key.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Reading Data

reading data is just as important, and the features available to do so are just as robust.

November 21, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Creating Data

As you’d expect, the last two are actually composite types, their contents also have type definitions:

November 20, 2021 | Dataweave, Mule 4, Mulesoft | No comments

SCRIPT ANATOMY

Notice in the script that there are three lines, a line with three dashes, then one more line. The first three lines of the script contain directives. The first directive, which is in every DataWeave file, defines which version the script is using.

November 19, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Text Java Properties Format

The Text Java Properties format parses any Java properties file. This format represents simple key-value pairs. DataWeave represents these pairs as an object with string values.

November 18, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Text Plain Format

The simplest way to store information in computer memory is as a single file with a plain text format.

November 18, 2021 | Dataweave, Mule 4, Mulesoft | No comments

Advertisement