Golang与couchbase集成问题

时间:2014-10-29 04:09:19

标签: go couchbase

我正在使用golang与couchbase集成组件go-couchbase。它可以连接couchbase并检索数据。但是我发送启动键并使用此API跳过值和限制值时遇到问题。因为我自己找不到任何功能。

url: - github.com/couchbaselabs/go-couchbase

请告诉我将这些值发送到couchbase并检索数据的方法吗?

1 个答案:

答案 0 :(得分:2)

该开始键仅提及一次,为parameter to a couhbase view

// View executes a view.
//
// The ddoc parameter is just the bare name of your design doc without
// the "_design/" prefix.
//
// Parameters are string keys with values that correspond to couchbase
// view parameters. Primitive should work fairly naturally (booleans,
// ints, strings, etc...) and other values will attempt to be JSON
// marshaled (useful for array indexing on on view keys, for example).
//
// Example:
//
// res, err := couchbase.View("myddoc", "myview", map[string]interface{}{
// "group_level": 2,
// "start_key": []interface{}{"thing"},
// "end_key": []interface{}{"thing", map[string]string{}},
// "stale": false,
// })
func (b *Bucket) View(ddoc, name string, params map[string]interface{}) (ViewResult, error) {

我认为skip一个(在“Pagination with Couchbase”中提到)只是要添加到params map[string]interface{}的另一个参数。