Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想在不使用绝对数组定位的情况下获取数组中的值。这是我的 json 有效负载。
{ "xyz":{ "abc":[ { "account":[ { "value":"savings" } ] } ] } }
如何使用 Data Weave 节省价值。
这个数据编织:
%dw 2.0 output application/json --- payload..value[0]
将产生:
savings
你也可以这样做。我想您不想使用所有索引,并且有效负载中只有一个键值:
%dw 2.0 output application/json var data = {"xyz": {"abc":["account":[{"value":"savings"}]]}} --- data..value reduce $