20 lines
883 B
JSON
20 lines
883 B
JSON
|
[
|
|||
|
{
|
|||
|
"operation": "shift",
|
|||
|
"spec": {
|
|||
|
"rating": {
|
|||
|
"primary": {
|
|||
|
"value": "Rating",//输出Rating:3
|
|||
|
"max": "RatingRange"//输出RatingRange:5
|
|||
|
},
|
|||
|
"*": {//匹配rating层级的quality、sharpness,除了primary
|
|||
|
"value": "SecondaryRatings.&1.Value",//左边:rating.*.value :右边: SecondaryRatings.*.Value
|
|||
|
"max": "SecondaryRatings.&1.Range",//左边:rating.*.max :右边: SecondaryRatings.*.Range
|
|||
|
"$": "SecondaryRatings.&1.Id" //表示使用输入键本身的值作为数据、左边 rating.*.quality or sharpness :右边: SecondaryRatings.*.Id
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
]
|
|||
|
// * 通配符只能在LHS使用、* 代表匹配整个key字符串,user-* 代表匹配以user开头的key字符串
|
|||
|
// &1 是回溯引用,指向上一层通配符 * 匹配到的键(如 "quality")
|