我正在尝试对下面的嵌套结构使用 Jolt 变换
I am trying to use Jolt transform for the below nested structure
我的输入 JSON 文档如下所示;
{
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": ""
},
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": "",
"customerNm": ""
}
我需要这种输出格式
{
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": "",
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": ""
},
"customerNm": ""
}
我使用的规范
[
{
"operation": "default",
"spec": {
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": "",
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": ""
},
"customerNm": ""
}
}
]
但输出看起来像这样;
{
"inquiry" : {
"status" : "",
"moredata" : "",
"selectPurgeInd" : "",
"analysis_name" : "",
"analysis_description" : "",
"inquirytype_name" : "",
"inquirytype_description" : "",
"actiontype_name" : "",
"actiontype_description" : "",
"class_name" : "",
"class_description" : "",
"domain_name" : "",
"domain_description" : "",
"source_name" : "",
"source_descriptions" : "",
"received_name" : "",
"received_description" : "",
"actiontype_code" : "",
"class_code" : "",
"opId" : "",
"openDt" : "",
"received_code" : "",
"systemInd" : "",
"inquirytype_code" : "",
"source_code" : "",
"inquiryNbr" : "",
"userId" : "",
"domain_code" : "",
"analysis_code" : ""
},
"inquiryNbr" : "",
"openDt" : "",
"opId" : "",
"userId" : "",
"systemInd" : "",
"analysis_code" : "",
"inquirytype_code" : "",
"actiontype_code" : "",
"class_code" : "",
"domain_code" : "",
"source_code" : "",
"received_code" : "",
"customerNm" : ""
}
任何人都可以帮忙
检查此规范,将所有值转移到查询对象即可。
[
{
"operation": "shift",
"spec": {
"inquiry": {
"*": "inquiry.&"
},
"*": "inquiry.&",
"customerNm": "customerNm"
}
}
]
我的输入 JSON 文档如下所示;
{
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": ""
},
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": "",
"customerNm": ""
}
我需要这种输出格式
{
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": "",
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": ""
},
"customerNm": ""
}
我使用的规范
[
{
"operation": "default",
"spec": {
"inquiry": {
"status": "",
"moredata": "",
"selectPurgeInd": "",
"analysis_name": "",
"analysis_description": "",
"inquirytype_name": "",
"inquirytype_description": "",
"actiontype_name": "",
"actiontype_description": "",
"class_name": "",
"class_description": "",
"domain_name": "",
"domain_description": "",
"source_name": "",
"source_descriptions": "",
"received_name": "",
"received_description": "",
"inquiryNbr": "",
"openDt": "",
"opId": "",
"userId": "",
"systemInd": "",
"analysis_code": "",
"inquirytype_code": "",
"actiontype_code": "",
"class_code": "",
"domain_code": "",
"source_code": "",
"received_code": ""
},
"customerNm": ""
}
}
]
但输出看起来像这样;
{
"inquiry" : {
"status" : "",
"moredata" : "",
"selectPurgeInd" : "",
"analysis_name" : "",
"analysis_description" : "",
"inquirytype_name" : "",
"inquirytype_description" : "",
"actiontype_name" : "",
"actiontype_description" : "",
"class_name" : "",
"class_description" : "",
"domain_name" : "",
"domain_description" : "",
"source_name" : "",
"source_descriptions" : "",
"received_name" : "",
"received_description" : "",
"actiontype_code" : "",
"class_code" : "",
"opId" : "",
"openDt" : "",
"received_code" : "",
"systemInd" : "",
"inquirytype_code" : "",
"source_code" : "",
"inquiryNbr" : "",
"userId" : "",
"domain_code" : "",
"analysis_code" : ""
},
"inquiryNbr" : "",
"openDt" : "",
"opId" : "",
"userId" : "",
"systemInd" : "",
"analysis_code" : "",
"inquirytype_code" : "",
"actiontype_code" : "",
"class_code" : "",
"domain_code" : "",
"source_code" : "",
"received_code" : "",
"customerNm" : ""
}
任何人都可以帮忙
检查此规范,将所有值转移到查询对象即可。
[
{
"operation": "shift",
"spec": {
"inquiry": {
"*": "inquiry.&"
},
"*": "inquiry.&",
"customerNm": "customerNm"
}
}
]