12

I am using the QueryBuilder in the Cassandra Java driver to insert some data.

There seems to be no easy option to set the TTL on the row I am inserting. None of the examples on the DataStax site show an example with TTL.

I suspect it has something to do with using() but once again, zero examples and minimal documentation in the code...

Jacek Furmankiewicz
  • 1,143
  • 1
  • 13
  • 22

1 Answers1

23

Finally figured it out, you have to pass in the static ttl() method on the QueryBuilder itself:

.using(ttl(30));
Jacek Furmankiewicz
  • 1,143
  • 1
  • 13
  • 22