如果存在,cassandra cqlengine批量更新

时间:2017-03-03 05:13:12

标签: python cassandra batch-updates cqlengine

我是卡桑德拉世界的新手。我试图在cassandra cqlengine中找到合适的api,只有先前存在一个记录才可以用来更新记录。

我遇到的例子没有解决这个特殊情况,而我的蛮力试图找到答案却失败了:(。

来自:https://datastax.github.io/python-driver/cqlengine/batches.html

# updating in a batch
b = BatchQuery()
em1.description = "new description"
em1.batch(b).save()
em2.description = "another new description"
em2.batch(b).save()
b.execute()

我已经尝试在模型和批处理对象上执行if_exists。它最终会创建新对象。

提前致谢。

0 个答案:

没有答案