2017-09-27 28 views
2

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

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

+0

好的。找到https://godoc.org/github.com/aerospike/aerospike-client-go#ListInsertOp并使用0作为索引...但不知道这将如何工作的邮件列表 – Crusaderpyro

回答

4

不熟悉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. 
+0

是。这就是我刚刚发现的,并添加了这个作为我的问题的评论。 – Crusaderpyro

相关问题