我想对以下输入数据进行分组和汇总。
{"users": [
{
"ADMIN": [
{
"ADMIN_03": 46,
"ADMIN_01": 2
}
],
"CUSTOMER": [
{
"CUSTOMER_01": 1
}
]
},
{
"ADMIN": [
{
"ADMIN_03": 35
}
]
},
{
"ADMIN": [
{
"ADMIN_01": 12
}
],
"CUSTOMER": [
{
"CUSTOMER_03": 2
}
]
}
]}
输出应按“ADMIN”之类的键分组,内部键/值对应分组和汇总。
{ "users": [
{
"ADMIN":[
{
"ADMIN_01": 14
"ADMIN_03": 81,
},
"CUSTOMER":[
{
"CUSTOMER_01": 1,
"CUSTOMER_03": 2
}
]
}
任何想法如何用 JSONATA 做到这一点?