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 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog