我有这个Jolt spec:
[
{
"operation": "shift",
"spec": {
"data": {
"*": {
"id": "[&1].id",
"Test_code": "[&1].Test_code",
"applyData": {
"Email": "[&2].Email",
"Address": "[&2].Address",
"Gender": "[&2].Gender",
"Date": "[&2].Date",
"Industry": "[&2].Industry",
"StartDate": "[&2].StartDate",
"TotalExperience": "[&2].TotalExperience"
}
}
}
}
}
]
而这input人:
{
"data": [
{
"id": "124354",
"applicantId": "10775119",
"Test_code": "123454",
"applyData": {
"Email": "blabla@gmail.com",
"Address": null,
"Gender": "M",
"Date": "2024-01-28 23:23:39",
"Industry": "IT-Software",
"StartDate": "2013-04-01",
"TotalExperience": "11"
}
}
]
}
这可以完美地工作,但如果缺少一些值,例如:Gender
,我需要在相同的位置收到性别设置为空的响应.(我try 将缺省值设置为NULL,但它会将值放在底部).
example input:
{
"data": [
{
"id": "124354",
"applicantId": "10775119",
"Test_code": "123454",
"applyData": {
"Email": "blabla@gmail.com",
"Address": null,
"Date": "2024-01-28 23:23:39",
"Industry": "IT-Software",
"StartDate": "2013-04-01",
"TotalExperience": "11"
}
}
]
}
desired output:
[
{
"id": "124354",
"Test_code": "123454",
"Email": "blabla@gmail.com",
"PermanentAddress": null,
"Gender": null,
"Date": "2024-01-28 23:23:39",
"Industry": "IT-Software",
"StartDate": "2013-04-01",
"TotalExperience": "11"
}
]