0
我不能拿出解決方案補丁語義:實現谷歌PATCH語義與Playframework 2.4 Json的變壓器
- 如果JSON有沒有財產,我需要跳過修改
- 如果JSON酒店
null
,我需要刪除此屬性(不要求性能)在其他情況下 - 我需要設置的值
我需要轉化爲mongo.db
更新命令(「$ unset」爲2,「$ set」爲3)
例如我需要存儲json與必需屬性「摘要」。所以:
{"summary": "modified by patch", "description": null}
必須轉換成:
{
"$set" : {
"summary": "modified by patch"
},
"$unset": {
"description": ""
}
}
此JSON
{"description": null}
必須轉換成( 「摘要」 跳過):
{
"$unset" : {
"description": ""
}
}
和爲此
{"summary": null}
我需要轉換錯誤(不能刪除必需的屬性)