Различия
Показаны различия между двумя версиями страницы.
| Предыдущая версия справа и слева Предыдущая версия Следующая версия | Предыдущая версия | ||
| develop:mule:dataweave [2024/02/25 19:38] – [map] mirocow | develop:mule:dataweave [2024/03/06 22:19] (текущий) – [Ссылки] mirocow | ||
|---|---|---|---|
| Строка 19: | Строка 19: | ||
| <note tip>IDE https:// | <note tip>IDE https:// | ||
| + | ===== Oprators ===== | ||
| + | |||
| + | * using: For initializing local variables in a DataWeave script. | ||
| + | * Unary DataWeave operators at this level: | ||
| + | * .^: Schema selector. | ||
| + | * .#: Namespace selector. | ||
| + | * ..: Descendants selector. | ||
| + | * not: Logical operator for negation. | ||
| + | * .@: All attribute selector, for example, in a case that uses the expression payload.root.a.@ to return the attributes and values of the input payload < | ||
| ==== Condition ==== | ==== Condition ==== | ||
| Строка 367: | Строка 376: | ||
| --- | --- | ||
| payload distinctBy $.id | payload distinctBy $.id | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | %dw 2.0 | ||
| + | output application/ | ||
| + | var str = [1, | ||
| + | var str1= [4,5,6,7,1] | ||
| + | --- | ||
| + | (str ++ str1) distinctBy ((item, index) ->item ) | ||
| </ | </ | ||
| Строка 634: | Строка 652: | ||
| </ | </ | ||
| + | < | ||
| + | %dw 2.0 | ||
| + | output application/ | ||
| + | --- | ||
| + | payload filterObject ((value, key) -> | ||
| + | (key as String != "first name" | ||
| + | and (key as String != "last name") | ||
| + | ) | ||
| + | </ | ||
| === flatten === | === flatten === | ||
| Строка 919: | Строка 946: | ||
| So result will be 9 | So result will be 9 | ||
| + | </ | ||
| + | |||
| + | < | ||
| + | %dw 2.0 | ||
| + | output application/ | ||
| + | |||
| + | var data = {" | ||
| + | --- | ||
| + | data..value reduce $ | ||
| </ | </ | ||
| Строка 1255: | Строка 1291: | ||
| * https:// | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||
| + | * https:// | ||