我是卡桑德拉世界的新手。我试图在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。它最终会创建新对象。
提前致谢。