Last active
September 16, 2015 13:14
-
-
Save ingenthr/701e903d50a2338a68f9 to your computer and use it in GitHub Desktop.
N1QL Query from Go
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
cluster, _ := gocb.Connect("couchbase://localhost") | |
bucket, _ := cluster.OpenBucket("default", "") | |
query := gocb.NewN1qlQuery("SELECT * FROM default") | |
rows := bucket.ExecuteViewQuery(query) | |
var row interface{} | |
for rows.Next(&row) { | |
fmt.Printf("Row: %+v\n", row) | |
} | |
rows.Close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment