3
votes

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

1 Answers

9
votes

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