2014-10-29 146 views
3

我使用的golang与couchbase集成组件称为go-couchbase。它可以连接到couchbase并检索数据。但是,我有一个问题发送开始键,并跳过值和限制值与此API。因为我自己找不到功能。Golang与couchbase集成问题

网址: - github.com/couchbaselabs/go-couchbase

请让我知道送这些值来couchbase和检索数据的任何方法?

回答

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{}

+0

谢谢我试试这个。 – mugzi 2014-10-30 09:14:58