Gojsonq Versions Save

A simple Go package to Query over JSON/YAML/XML/CSV Data

v2.5.2

4 years ago

While using reset() method, the error was not resetting. See issue #80

v2.5.1

4 years ago

Fix go mod issue #78

v2.5.0

4 years ago

Add FromInterface method that solves issue #67 Fix Result As method that solves issue #72

Thanks, @Dragomir-Ivanov and @cifren !

v2.4.0

4 years ago

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)

v2.3.0

4 years ago

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)

v2.2.2

4 years ago

v2.2.1

4 years ago

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}

v2.2.0

5 years ago

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()

v1.9.0

5 years ago

Add Out method

v2.0.0

5 years ago

Stable API; Add More method