doulu2591 2017-09-27 06: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-27 07: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.
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 kafka 分区副本增加会导致消息丢失或者不可用吗?
  • ¥15 微信公众号自制会员卡没有收款渠道啊
  • ¥15 stable diffusion
  • ¥100 Jenkins自动化部署—悬赏100元
  • ¥15 关于#python#的问题:求帮写python代码
  • ¥20 MATLAB画图图形出现上下震荡的线条
  • ¥15 关于#windows#的问题:怎么用WIN 11系统的电脑 克隆WIN NT3.51-4.0系统的硬盘
  • ¥15 perl MISA分析p3_in脚本出错
  • ¥15 k8s部署jupyterlab,jupyterlab保存不了文件
  • ¥15 ubuntu虚拟机打包apk错误