【问题标题】:How to Prepend to a list in aerospike using golang?如何使用 golang 在 aerospike 中添加列表?
【发布时间】:2017-09-27 06:55:43
【问题描述】:

在 aerospike 中,https://godoc.org/github.com/aerospike/aerospike-client-go#ListAppendOp 操作可以与 client.Operate 方法一起使用以追加到列表中。有没有办法添加到列表中?

http://www.aerospike.com/docs/guide/cdt-list.html#development-guidelines-and-tips 确实提到插入可以发生在列表的任一端。但是找不到合适的 API 来做同样的事情。有什么帮助吗?

【问题讨论】:

标签: go aerospike


【解决方案1】:

不熟悉 Go 客户端,只是看 API,会在前面指定索引为 0 吗?

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.

【讨论】:

  • 是的。这就是我刚刚发现的并将其添加为对我的问题的评论。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-01-23
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2020-05-14
  • 2021-01-04
相关资源
最近更新 更多