I'm developing a server in golang with Couchbase (using the new Couchbase 
Go SDK). Unfortunately, I've hit a roadblock and cannot find any complete 
examples to reference.

When you query a view, how do you access:

1. the total number of rows returned?
2. access the key/value fields in the row returned by Next()

Seems like it should be obvious. Here is a snippet I'm using based on the 
example at:
http://docs.couchbase.com/developer/go-beta/view-queries.html


myQuery := gocb.NewViewQuery("tokens", "blacklist_tokens")
rows := bucket.ExecuteViewQuery(myQuery)

// ??? How do you get the result (row) count, here?

var row interface{}
for rows.Next(&row) {
   fmt.Printf("Row: %+v\n", row)   // ??? How do your access the key and 
value fields, here?
}
if err := rows.Close(); err != nil {
   fmt.Printf("View query error: %s\n", err)
}


Thanks for any help with this.

-- 
You received this message because you are subscribed to the Google Groups 
"Couchbase" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to