【发布时间】:2022-01-17 22:24:47
【问题描述】:
我正在尝试找到一个能产生所需输出的规范数组
输入:
{
"aggregations": {
"masterId": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "1Q52",
"doc_count": 3,
"serialNumbers": {
"doc_count_error_upper_bound": 0,
"sum_other_doc_count": 0,
"buckets": [
{
"key": "3R24Z3",
"count": 1
},
{
"key": "526GA2",
"count": 1
},
{
"key": "873XHE",
"count": 1
}
]
}
}
]
}
}
}
规格: 试图解决这个问题
期望的输出:
{
"1Q52": ["3R24Z3", "526GA2", "873XHE"]
}
我当前的 Spec 数组是
[
{
"operation": "shift",
"spec": {
"aggregations": {
"masterId": {
"buckets": {
"*": {
"key": "key",
"serialNumbers": {
"buckets": {
"*": {
"key": "key"
}
}
}
}
}
}
}
}
}
]
我目前的输出是
{
"key" : [ "1Q52", "3R24Z3", "526GA2", "873XHE" ]
}
什么样的规格数组可以给我想要的输出?
【问题讨论】: