doulu2591 2017-09-26 22:55
浏览 99
已采纳

如何使用golang在Aerospike中添加列表?

In aerospike, the https://godoc.org/github.com/aerospike/aerospike-client-go#ListAppendOp operation can be used along with client.Operate method to append to a list. Is there a way to Prepend to the list ?

The http://www.aerospike.com/docs/guide/cdt-list.html#development-guidelines-and-tips does mention that insertions can happen at either end of the list. But could not find the right API to do the same. Any help ?

  • 写回答

1条回答 默认 最新

  • douchixu3686 2017-09-26 23:38
    关注

    Not familiar with Go client but just looking at the API, would specifying the index as 0 prepend it?

    func ListInsertOp
    func ListInsertOp(binName string, index int, values ...interface{}) *Operation
    ListInsertOp creates a list insert operation. Server inserts value to specified index of list bin. Server returns list size on bin name. It will panic is no values have been passed.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部