-
-
Save thedevsaddam/9bed1a6ae36c0280ab269df03f96831d to your computer and use it in GitHub Desktop.
gojsonq how to use Only method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/thedevsaddam/gojsonq" | |
) | |
func main() { | |
jq := gojsonq.New().File("./sample-data.json") | |
res := jq.From("vendor.items").Where("price", ">", 1200).OrWhere("id", "=", nil).Only("name", "price") | |
fmt.Println(res) | |
// output: [map[name:MacBook Pro 13 inch retina price:1350] map[name:MacBook Pro 15 inch retina price:1700] map[name:HP core i3 SSD price:850]] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment