Releases: thedevsaddam/gojsonq
Releases · thedevsaddam/gojsonq
Fix error reset on calling Reset method. Issue #80
While using reset()
method, the error was not resetting. See issue #80
Fix go mod issue
Fix go mod issue #78
Add FromInterface Method and Fix Result As method
Add FromInterface
method that solves issue #67
Fix Result As
method that solves issue #72
Thanks, @Dragomir-Ivanov and @cifren !
Update As method
Result.As()
supports all the available method in Result type except for the methods with an argument like Time
result, _ := gojsonq.New().FromString(jsonStr).From("prices").GetR() // handle error
var prices []float32
result.As(&prices) // handle error
fmt.Printf("%#v\n", prices)
Add support for Result instance
The Result instance will return different methods to get static type.
const json = `{"name":{"first":"Tom","last":"Hanks"},"age":61}`
result, err := gojsonq.New().JSONString(json).FindR("name.first")
if err != nil {
log.Fatal(err)
}
name, _ := result.String()
fmt.Println(name)
Fix duplicate distinct method call from only method
v2.2.2 Fix duplicate distinct method call from only method
Fix select attributes for First,Last & Nth methods
Fix select attributes for First,Last & Nth methods
res := gojsonq.New().File("./data.json").From("items").Select("name", "price").First()
fmt.Printf("%#v\n", res)
Output
map[string]interface {}{"name":"MacBook Pro 13 inch retina", "price":1350}
Add Offset, Writer and FromString method
Offset
gojsonq.New().File("./data.json").From("items").Offset(10).Limit(10).Get()
Writer
gojsonq.New().File("./data.json").From("items").SortBy("price").Writer(os.Stdout)
FromString
gojsonq.New().FromString(jsonStr).From("items").Get()
Fix separator issue for deep sort and alias
Fix separator issue for deep sort and alias see pr #40
Stable API; Add More method
Stable API; Add More method