Flex Gateway新着情報
Governance新着情報
Monitoring API ManagerFlex Gateway新着情報
Governance新着情報
Monitoring API Manager2.x
Mule 4
3.9
1.1
2.x
1.2
7.x
filterArrayLeafs
filterArrayLeafs
絞り込み式を配列のリーフまたは Path
値に適用します。
配列のリーフ値は SimpleType
値または Null
値である必要があります。型の説明については、 「Core 型」を参照してください。
DataWeave バージョン 2.4.0 で導入されました。
名前 | 説明 |
---|---|
|
|
|
入力 |
次の例では、さまざまな入力での filterArrayLeafs
の動作を示します。
%dw 2.0
import * from dw::util::Tree
var myArray = [1, {name: ["", true], test: 213}, "123", null]
output application/json
---
{
a: myArray filterArrayLeafs ((value, path) ->
!(value is Null or value is String)),
b: myArray filterArrayLeafs ((value, path) ->
(value is Null or value == 1)),
c: { a : [1,2] } filterArrayLeafs ((value, path) ->
(value is Null or value == 1)),
d: myArray filterArrayLeafs ((value, path) ->
!isArrayType(path))
}
DataWeave
{
"a": [
1,
{
"name": [
true
],
"test": 213
}
],
"b": [
1,
{
"name": [
],
"test": 213
},
null
],
"c": {
"a": [
1
]
},
"d": [
{
"name": [
],
"test": 213
}
]
}
Jsonコンテンツを展開する