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

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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 树莓派与pix飞控通信
  • ¥15 自动转发微信群信息到另外一个微信群
  • ¥15 outlook无法配置成功
  • ¥30 这是哪个作者做的宝宝起名网站
  • ¥60 版本过低apk如何修改可以兼容新的安卓系统
  • ¥25 由IPR导致的DRIVER_POWER_STATE_FAILURE蓝屏
  • ¥50 有数据,怎么建立模型求影响全要素生产率的因素
  • ¥50 有数据,怎么用matlab求全要素生产率
  • ¥15 TI的insta-spin例程
  • ¥15 完成下列问题完成下列问题