NiFi中的JoltTransferMJSON处理器
输入: 需要这种格式的输出,我的Jolt规范应该是什么NiFi中的JoltTransferMJSON处理器,json,apache-nifi,jolt,Json,Apache Nifi,Jolt,输入: 需要这种格式的输出,我的Jolt规范应该是什么 { "table": [{ "_id": { "personId": 1234, "customer": 345, "locale": "en" }} ] } 请尝试以下示例: { "table": [{ "personId": 1234, "customer": 345,
{ "table": [{
"_id": {
"personId": 1234,
"customer": 345,
"locale": "en"
}} ] }
请尝试以下示例:
{
"table": [{
"personId": 1234,
"customer": 345,
"locale": "en"
}]
}
我找到了解决办法
[
{
"operation": "shift",
"spec": {
"table": {
// table items
"*": {
// internal object in item under "_id" key
"*": "table[]"
}
}
}
}
]
@用户3533870,你确定吗?我已经用计算机对它进行了测试。我使用了你的
JSON
有效载荷
和我的转换
,它打印出与你想要的相同的结果。很抱歉,它现在起作用了,我已经接受了你的回答。
[
{
"operation": "shift",
"spec": {
"*": {
"*": {
"_id": {
"personId": "table[&2].personId",
"customer": "table[&2].customer",
"locale": "table[&2].locale"
}
}
}
}
}
]