strVal := value.NewValue("hello world")
objVal := value.NewValue(map[string]interface{}{ "name": "John", "age": 30, "likes": []string{"music", "sports", "reading"}, })
likesVal, err := objVal.Field("likes") if err != nil { // handle error } likesArr, err := likesVal.ToArray() if err != nil { // handle error } for _, like := range likesArr { fmt.Println(like.String()) }Overall, the github.com/couchbase/query/value package is a useful package library for working with JSON-based values in Go, providing a rich set of features and methods for working with JSON objects and arrays.