使用 Jolt 插入电流 Date/Time
Insert Current Date/Time Using Jolt
在尝试使用 Jolt 插入当前 date/time 时需要帮助。
我尝试(如下所示)使用 "${now()}";但是输出没有产生 date/time.
JSON 输入:
[
{
"ProdId": "Filler",
"ProductName": "Z Dry Filler",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
},
{
"ProdId": "Clay",
"ProductName": "Z Clay",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
}
]
颠簸规格:
[
{
"operation": "default",
"spec": {
"*": {
"LastUpdated": "${now()}"
}
}
}
]
输出:
[ {
"ProdId" : "Filler",
"ProductName" : "Z Dry Filler",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "${now()}"
}, {
"ProdId" : "Clay",
"ProductName" : "Z Clay",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "${now()}"
} ]
期望输出:
[ {
"ProdId" : "Filler",
"ProductName" : "Z Dry Filler",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "2018-03-06T15:38:19Z"
}, {
"ProdId" : "Clay",
"ProductName" : "Z Clay",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "2018-03-06T15:38:19Z"
} ]
我不确定 Jolt 能否接受这样的变量。
在此先感谢您的帮助。
开发者在这里回答。简短的回答是,目前在 Jolt 中它本身是不可能的。
https://github.com/bazaarvoice/jolt/issues/531#issuecomment-370956891
在尝试使用 Jolt 插入当前 date/time 时需要帮助。
我尝试(如下所示)使用 "${now()}";但是输出没有产生 date/time.
JSON 输入:
[
{
"ProdId": "Filler",
"ProductName": "Z Dry Filler",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
},
{
"ProdId": "Clay",
"ProductName": "Z Clay",
"Trait": "",
"Variety": "",
"SuggestedRetailPrice": "0.0000",
"CropId": "",
"DeptId": "067001"
}
]
颠簸规格:
[
{
"operation": "default",
"spec": {
"*": {
"LastUpdated": "${now()}"
}
}
}
]
输出:
[ {
"ProdId" : "Filler",
"ProductName" : "Z Dry Filler",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "${now()}"
}, {
"ProdId" : "Clay",
"ProductName" : "Z Clay",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "${now()}"
} ]
期望输出:
[ {
"ProdId" : "Filler",
"ProductName" : "Z Dry Filler",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "2018-03-06T15:38:19Z"
}, {
"ProdId" : "Clay",
"ProductName" : "Z Clay",
"Trait" : "",
"Variety" : "",
"SuggestedRetailPrice" : "0.0000",
"CropId" : "",
"DeptId" : "067001",
"LastUpdated" : "2018-03-06T15:38:19Z"
} ]
我不确定 Jolt 能否接受这样的变量。
在此先感谢您的帮助。
开发者在这里回答。简短的回答是,目前在 Jolt 中它本身是不可能的。
https://github.com/bazaarvoice/jolt/issues/531#issuecomment-370956891