Closed zfeng-idcf closed 3 years ago
package main import ( "fmt" gojsonq "github.com/thedevsaddam/gojsonq/v2" ) func main() { const jsonStr = `[{"a": 1, "b":2,"c":[1,2,3]}]` jq := gojsonq.New().JSONString(jsonStr) val := jq.WhereEqual("a", 1).Find("[0].c") fmt.Println("val: ", val) // should be [1,2,3], but the result is [] val = jq.Reset().Find("[0].c") fmt.Println("val: ", val) // => [1,2,3] }
I misunderstood. Find and Where cannot be used together.
Find
Where