dpfln86244
dpfln86244
2014-10-29 04:09
浏览 84
已采纳

Golang与Couchbase集成问题

I'm using golang with couchbase integration component called go-couchbase. It's enable to connect with couchbase and retrieve data. However I have a problem to send start key and skip value and limit value with this API. Because there is no functionality found by myself.

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

Please let me know any method to send these values to couchbase and retrieve data?

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

1条回答 默认 最新

  • dongmen1925
    dongmen1925 2014-10-29 06:53
    已采纳

    That start key is only mentioned once, as a 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) {
    

    I suppose the skip one (mentioned in "Pagination with Couchbase") is just another parameter to add to the params map[string]interface{}.

    点赞 评论

相关推荐