jolt - 如何仅在 JOLT 中的字段不为空时进行映射
问题描述
这是我的输入:
{ "isPoolPoint": "test", "timeZone": "ET" }
我希望输出为:
{ "address" : [{"line2": "test"}] }
isPoolPoint
如果是 a ,我不应该得到任何输出null
。
解决方案
规格
[
{
"operation": "shift",
"spec": {
"isPoolPoint": {
// match down into the values of "isPoolPoint"
// if we match null, then do nothing
"null": null,
// match everything else
"*": {
// write what was matched to the output
"$": "address[0].line2"
}
}
}
}
]
推荐阅读
- speech-recognition - 如何确定语音识别中 HMM 的观察序列长度
- powerbi-desktop - PowerBI:显示除第一个季度外的前 5 个季度
- reactjs - 如何整合react?
- javascript - 从 jqgrid 获取特定数据
- cordova - 使用 Firestore 的 Cordova 应用程序无法在某些设备上运行
- c# - C# 绘制简单连接对象的图表
- java - Java 计数器问题
- node.js - 用于链式方法的 Sinon 存根
- angular - (角度)输入文本事件绑定与双向绑定之间是否有任何性能改进?
- python - 从主文件夹的子文件夹中随机提取文件