# mulesoft DataWeave - Full Documentation --- product: DataWeave version: 2.11 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.12 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.3 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(Array, Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.

Name

Description

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--({ (K)?: V }, Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(Object, Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(Object, Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` --- product: DataWeave version: 2.4 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.6 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.9 --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.13 is-latest-version: true --- # \-- > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## \--(source: Array, toRemove: Array): Array Removes specified values from an input value. This version of `--` removes all instances of the specified items from an array. Other versions act on objects, strings, and the various date and time formats that are supported by DataWeave.
NameDescription

source

The array containing items to remove.

toRemove

Items to remove from the source array.

### Example This example removes specified items from an array. Specifically, it removes all instances of the items listed in the array on the right side of `--` from the array on the left side of the function, leaving `[0]` as the result. #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, 1, 2] -- [1,2] } ``` #### Output ```JSON { "a": [0] } ``` ## \--(source: { (K)?: V }, toRemove: Object): { (K)?: V } Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

Object that contains the key-value pairs to remove from the source object.

### Example This example removes a key-value pair from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- { "hello" : "world"} ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Object, keys: Array) Removes all key-value pairs from the source object that match the specified search key. ### Parameters
NameDescription

source

The source object (an Object type).

toRemove

An array of keys to specify the key-value pairs to remove from the source object.

### Example This example removes two key-value pairs from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "yes" : "no", "good" : "bad", "old" : "new" } -- ["yes", "old"] ``` #### Output ```JSON { "good": "bad" } ``` ## \--(source: Object, keys: Array) Removes specified key-value pairs from an object. ### Parameters
NameDescription

source

The source object (an Object type).

keys

A keys for the key-value pairs to remove from the source object.

### Example This example specifies the key-value pair to remove from the source object. #### Source ```DataWeave %dw 2.0 output application/json --- { "hello" : "world", "name" : "DW" } -- ["hello" as Key] ``` #### Output ```JSON { "name": "DW" } ``` ## \--(source: Null, keys: Any) Helper function that enables `--` to work with a `null` value. _Introduced in DataWeave version 2.4.0._ --- product: DataWeave version: 2.11 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.12 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.3 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(Array, Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(String, String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(T, Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(Date, LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(LocalTime, Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(Date, Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(Time, Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(Date, TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(TimeZone, Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(LocalDateTime, TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(TimeZone, LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(LocalTime, TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(TimeZone, LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.4 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.6 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.9 --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.13 is-latest-version: true --- # ++ > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## ++(source: Array, with: Array): Array Concatenates two values. This version of `++` concatenates the elements of two arrays into a new array. Other versions act on strings, objects, and the various date and time formats that DataWeave supports. If the two arrays contain different types of elements, the resulting array is all of `S` type elements of `Array` followed by all the `T` type elements of `Array`. Either of the arrays can also have mixed-type elements. Also note that the arrays can contain any supported data type. ### Parameters
NameDescription

source

The source array.

with

The array to concatenate with the source array.

### Example The example concatenates an `Array` with an `Array`. Notice that it outputs the result as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "result" : [0, 1, 2] ++ ["a", "b", "c"] } ``` #### Output ```JSON { "result": [0, 1, 2, "a", "b", "c"] } ``` ### Example #### Source ```DataWeave %dw 2.0 output application/json --- { "a" : [0, 1, true, "my string"] ++ [2, [3,4,5], {"a": 6}] } ``` #### Output ```JSON { "a": [0, 1, true, "my string", 2, [3, 4, 5], { "a": 6}] } ``` ## ++(source: String, with: String): String Concatenates the characters of two strings. Strings are treated as arrays of characters, so the `++` operator concatenates the characters of each string as if they were arrays of single-character string. ### Parameters
NameDescription

source

The source string.

with

The string to concatenate with the source string.

### Example This example concatenates two strings. Here, `Mule` is treated as `Array ["M", "u", "l", "e"]`. Notice that the example outputs the result `MuleSoft` as the value of a JSON object. #### Source ```DataWeave %dw 2.0 output application/json --- { "name" : "Mule" ++ "Soft" } ``` #### Output ```JSON { "name": "MuleSoft" } ``` ## ++(source: T, with: Q): T & Q Concatenates two objects and returns one flattened object. The `++` operator extracts all the key-values pairs from each object, then combines them together into one result object. ### Parameters
NameDescription

source

The source object.

with

The object to concatenate with the source object.

### Example This example concatenates two objects and transforms them to XML. Notice that it flattens the array of objects `{aa: "a", bb: "b"}` into separate XML elements and that the output uses the keys of the specified JSON objects as XML elements and the values of those objects as XML values. #### Source ```DataWeave %dw 2.0 output application/xml --- { concat : {aa: "a", bb: "b"} ++ {cc: "c"} } ``` #### Output ```XML a b c ``` ## ++(date: Date, time: LocalTime): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime` value. `Date` and `LocalTime` instances are written in standard Java notation, surrounded by pipe (`|`) symbols. The result is a `LocalDateTime` object in the standard Java format. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``Date LocalTime` produces the same result as `LocalTime Date``. ### Parameters
NameDescription

date

A Date.

time

A LocalTime, a time format without a time zone.

### Example This example concatenates a `Date` and `LocalTime` object to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|2017-10-01| ++ |23:57:59|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(time: LocalTime, date: Date): LocalDateTime Appends a `LocalTime` with a `Date` to return a `LocalDateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, ``LocalTime Date` produces the same result as `Date LocalTime``. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

date

A Date.

### Example This example concatenates `LocalTime` and `Date` objects to return a `LocalDateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "LocalDateTime" : (|23:57:59| ++ |2003-10-01|) } ``` #### Output ```JSON { "LocalDateTime": "2017-10-01T23:57:59" } ``` ## ++(date: Date, time: Time): DateTime Appends a `Date` to a `Time` in order to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as `Time` + `Date`. ### Parameters
NameDescription

date

A Date.

time

A Time, a time format that can include a time zone (Z or HH:mm).

### Example This example concatenates `Date` and `Time` objects to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- [ |2017-10-01| ++ |23:57:59-03:00|, |2017-10-01| ++ |23:57:59Z| ] ``` #### Output ```JSON [ "2017-10-01T23:57:59-03:00", "2017-10-01T23:57:59Z" ] ``` ## ++(time: Time, date: Date): DateTime Appends a `Date` to a `Time` object to return a `DateTime`. Note that the order in which the two objects are concatenated is irrelevant, so logically, `Date` + `Time` produces the same result as a `Time` + `Date`. ### Parameters
NameDescription

time

A Time, a time format that can include a time zone (Z or HH:mm).

date

A Date.

### Example This example concatenates a `Date` with a `Time` to output a `DateTime`. Notice that the inputs are surrounded by pipes (`|`). #### Source ```DataWeave %dw 2.0 output application/json --- |2018-11-30| ++ |23:57:59+01:00| ``` #### Output ```JSON "2018-11-30T23:57:59+01:00" ``` ### Example This example concatenates `Time` and `Date` objects to return `DateTime` objects. Note that the first `LocalTime` ``object is coerced to a `Time``. Notice that the order of the date and time inputs does not change the order of the output `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime1" : (|23:57:59| as Time) ++ |2017-10-01|, "DateTime2" : |23:57:59Z| ++ |2017-10-01|, "DateTime3" : |2017-10-01| ++ |23:57:59+02:00| } ``` #### Output ```JSON { "DateTime1": "2017-10-01T23:57:59Z", "DateTime2": "2017-10-01T23:57:59Z", "DateTime3": "2017-10-01T23:57:59+02:00" } ``` ## ++(date: Date, timezone: TimeZone): DateTime Appends a `TimeZone` to a `Date` type value and returns a `DateTime` result. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `Date` and `TimeZone` (`-03:00`) to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2017-10-01| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(timezone: TimeZone, date: Date): DateTime Appends a `Date` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

date

A Date.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `Date` to return a `DateTime`. Note the local time in the `DateTime` is `00:00:00` (midnight). #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : |-03:00| ++ |2017-10-01| } ``` #### Output ```JSON { "DateTime": "2017-10-01T00:00:00-03:00" } ``` ## ++(dateTime: LocalDateTime, timezone: TimeZone): DateTime Appends a `TimeZone` to a `LocalDateTime` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalDateTime` and `TimeZone` (`-03:00`) to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "DateTime" : (|2003-10-01T23:57:59| ++ |-03:00|) } ``` #### Output ```JSON { "DateTime": "2003-10-01T23:57:59-03:00 } ``` ## ++(timezone: TimeZone, datetime: LocalDateTime): DateTime Appends a `LocalDateTime` to a `TimeZone` in order to return a `DateTime`. ### Parameters
NameDescription

dateTime

A LocalDateTime, a date and time without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalDateTime` to return a `DateTime`. #### Source ```DataWeave %dw 2.0 output application/json --- { "TimeZone" : (|-03:00| ++ |2003-10-01T23:57:59|) } ``` #### Output ```JSON { "TimeZone": "2003-10-01T23:57:59-03:00" } ``` ## ++(time: LocalTime, timezone: TimeZone): Time Appends a `TimeZone` to a `LocalTime` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `LocalTime` and `TimeZone` (`-03:00`) to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|23:57| ++ |-03:00|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` ## ++(timezone: TimeZone, time: LocalTime): Time Appends a `LocalTime` to a `TimeZone` in order to return a `Time`. ### Parameters
NameDescription

time

A LocalTime, a time format without a time zone.

timezone

A TimeZone (Z or HH:mm).

### Example This example concatenates `TimeZone` (`-03:00`) and `LocalTime` to return a `Time`. Note that the output returns\`:00\` for the unspecified seconds. #### Source ```DataWeave %dw 2.0 output application/json --- { "Time" : (|-03:00| ++ |23:57|) } ``` #### Output ```JSON { "Time": "23:57:00-03:00" } ``` --- product: DataWeave version: 2.11 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.12 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.3 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Parameters
NameDescription

number

The number to apply the operation to.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.4 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.6 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.9 --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.13 is-latest-version: true --- # abs > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## abs(number: Number): Number Returns the absolute value of a number. ### Parameters
NameDescription

number

The number to evaluate.

### Example This example returns the absolute value of the specified numbers. #### Source ```DataWeave %dw 2.0 output application/json --- [ abs(-2), abs(2.5), abs(-3.4), abs(3) ] ``` #### Output ```JSON [ 2, 2.5, 3.4, 3 ] ``` --- product: DataWeave version: 2.11 --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.12 --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.4 --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.6 --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.9 --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.13 is-latest-version: true --- # acos > For the full documentation index, see: https://docs.mulesoft.com/llms.txt ## acos(angle: Number): Number | NaN Returns an arc cosine value that can range from `0.0` through pi. If the absolute value of the input is greater than `1`, the result is `null`. _Introduced in DataWeave version 2.4.0._ ### Parameters
NameDescription

angle

Number to convert into it arc cosine value.

### Example This example shows how `acos` behaves with different inputs. #### Source ```DataWeave %dw 2.0 import * from dw::util::Math output application/json --- { "acos0": acos(0), "acos13": acos(0.13), "acos-1": acos(-1), "acos1": acos(1), "acos1.1": acos(1.1) } ``` #### Output ```Json { "acos0": 1.5707963267948966, "acos13": 1.440427347091751, "acos-1": 3.141592653589793, "acos1": 0.0, "acos1.1": null } ``` --- product: DataWeave version: 2.11 keywords: studio, anypoint, transform, transformer, format, xml, json, metadata, dataweave, data weave, datamapper, dwl, dfl, dw, output structure, input structure, map, mapping --- # Add and Subtract Time > For the full documentation index, see: https://docs.mulesoft.com/llms.txt This DataWeave example shows multiple addition and subtraction operations that deal with date and time types. The examples use: - `as` function to coerce a String to Period type - `PT