kangarooDataCenterV3/jolt-demo/shift/spec10.json

29 lines
906 B
JSON
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

[
{
"operation": "shift",
"spec": {
"foo": {
"$": "place.to.put.key",//$获取到key本身输出到place.to.put.key、place.to.put.key=foo
"@": "place.to.put.value"//@获取到key对应的value输出到place.to.put.value、place.to.put.value=1
}
}
}
]
//在LHS@是根节点,不允许有子节点???
//在LHS中@代表当前处理层级的根位置(不是整个输入json的root)
//@对应的value只能为简单只比如1、"2"、"xxxx"、不能是"foo":{"xx":"1"}
//@的设计是直接提取当前层级的完整值,而非遍历子树
//若值本身是对象(如 { "address": { ... } }),则@无法处理其内部字段,需改用其他通配符(如&或*
//{
// "place": {
// "to": {
// "put": {
// "key": "foo",
// "value": "1"
// }
// }
// }
//}