Ziklag
Ziklag

Reputation: 251

Update TTL for entire row when doing CQL update statement

Assume you have a row with 4 columns, that when you created it, you set a TTL of 1 hour.

I need to occasionally update the date column of the row, and at the same time update the TTL of the entire row.

Asusming this doesn't work, whats the correct way to achieve this?

update mytable using ttl 3600
set accessed_on=? 

Upvotes: 4

Views: 1399

Answers (1)

David Webb
David Webb

Reputation: 492

Cassandra supports TTL per column only, which is a nice flexible features, but the ability to TTL a row is a feature that has been requested many times.

Your only option is to update all columns on the row, thereby updating the TTL on all the columns.

Upvotes: 4

Related Questions