支持单层slice提取
This commit is contained in:
parent
89b8411fb2
commit
c92a8516d4
@ -70,7 +70,7 @@ func (f *Filter) Result() (*DynamicJSON, error) {
|
||||
data := item.Map()
|
||||
for _, key := range ketList {
|
||||
if v, exist := data[key]; exist {
|
||||
result.SetValue(fmt.Sprintf(pathArr[0]+".[%d]."+key, idx), data[key].Raw, v.IsObject() || v.IsArray())
|
||||
result.SetValue(strings.ReplaceAll(newDataPath, "[]", fmt.Sprintf("[%d]", idx)), data[key].Raw, v.IsObject() || v.IsArray())
|
||||
}
|
||||
// 结果集中不存在对应key,丢弃
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user