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

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

    报告相同问题?

    悬赏问题

    • ¥100 webapi的部署(标签-服务器)
    • ¥20 怎么加快手机软件内部计时的时间(关键词-日期时间)
    • ¥15 C语言除0问题的检测方法
    • ¥15 为什么四分管的内径有的是16mm有的15mm,四分不应该是12.7mm吗
    • ¥15 macos13下 ios交叉编译的问题
    • ¥15 bgz压缩文件怎么打开
    • ¥15 封装dll(引入了pcl的点云设计库)
    • ¥30 关于#开发语言#的问题:我需要在抄板的基础上再抄板抄程序,根据RDA8851CM基础上开发
    • ¥15 oracle 多个括号,怎么删除指定的括号及里面的内容?
    • ¥15 小新14API2019想用bios调风扇