给定一个对象(“includeFields”),指定应将另一个对象(“toBeFiltered”)的哪些属性提取到新的结果对象中:
{
"toBeFiltered": {
"a": "AAA",
"b": "BBB", // Excluded from the result as "includeFields" doesn't include "b"
"c": "CCC"
},
"includeFields": {
"a": true,
"c": true
}
}
何时:一些 JsonPath 表达式检查“toBeFiltered”中的哪些字段名称也出现在“includeFields”中
然后:
{
"a": "AAA",
"c": "CCC"
}
是否可以使用 JsonPath 执行此操作?如果可以 - JsonPath (Jayway) 表达式会是什么样子?