【发布时间】:2016-02-29 17:49:43
【问题描述】:
我想不出补丁语义的解决方案:
- 如果json没有属性,我需要跳过修改
- 如果json属性有
null,我需要删除这个属性(对于不需要的属性) - 在其他情况下我需要设置值
我需要转换成mongo.db更新命令(“$unset”代表2,“$set”代表3)
例如,我需要使用 必需属性“summary” 存储 json。所以:
{"summary": "modified by patch", "description": null}
必须转换为:
{
"$set" : {
"summary": "modified by patch"
},
"$unset": {
"description": ""
}
}
这个json
{"description": null}
必须转换为(跳过“摘要”):
{
"$unset" : {
"description": ""
}
}
为了这个
{"summary": null}
我需要转换错误(无法删除所需的属性)
【问题讨论】:
标签: json playframework playframework-2.0 transform