0
votes

I´m learning Cassandra CQL using CQL 3.1 documentation manual on mac with cassandra installed from homebrew (cqlsh 4.0.0 | Cassandra 2.0.0 | CQL spec 3.1.0 | Thrift protocol 19.37.0). From cqlsh, when I enter collections map example number 7:

UPDATE users USING TTL <computed_ttl> SET todo['2012-10-1'] = 'find water' WHERE user_id = 'frodo';

I´m getting this error:

Bad Request: line 1:22 no viable alternative at input '<'

So, docs are wrong or am I doing something wrong?

1

1 Answers

2
votes

You need to replace <computed_ttl> with an actual TTL e.g.

UPDATE users USING TTL 100 SET todo['2012-10-1'] = 'find water' WHERE user_id = 'frodo';

which would cause the value to expire after 100 seconds.