2014-10-29 127 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