Cassandra data stax Query Builder Update

↘锁芯ラ 提交于 2019-12-06 06:42:19

问题


I am trying to write a simple Update query - Update table set col1 = val1, col2 = val2 where col3 = val3; Can you please provide an example of writing a simple UPDATE in Cassandra using the Query builder API?


回答1:


Try this out.

v1.x:

Query exampleQuery = update("table").with(set("col1", "val1")).and(set("col2","val2")).where(eq("col3","val3"));

v2.x:

Statement exampleQuery = update("table").with(set("col1", "val1")).and(set("col2","val2")).where(eq("col3","val3"));

Patrick



来源:https://stackoverflow.com/questions/19557110/cassandra-data-stax-query-builder-update

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!