Closed BeanWei closed 5 years ago
Use Reset method to start query again. When you use a final Result fetching method like Get/Find/First/Last
etc you have to use Reset method to query the same document again.
Solution:
package main
import (
"fmt"
"github.com/thedevsaddam/gojsonq"
)
func main() {
const json = `{"name": "BeanWei", "Age": "23", "foucus": ["python", "golang", "Kotlin"]}`
dom := gojsonq.New().JSONString(json)
name := dom.Find("name")
age := dom.Reset().Find("Age")
ist := dom.Reset().Find("foucus.[1]")
fmt.Println(name, age, ist)
}
this way aren't supported?