incubator-cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jimmy Lin <>
Subject fixed size collection possible?
Date Tue, 22 Apr 2014 06:51:27 GMT
look at the collection type support in cql3,

we can append or remove using "+" and "-" operator

UPDATE users
  SET top_places = top_places + [ 'mordor' ] WHERE user_id = 'frodo';

UPDATE users
  SET top_places = top_places - ['riddermark'] WHERE user_id = 'frodo';

is there a way to keep a fixed size of the list(collection) ?

I was thinking about using TTL to remove older data after certain time
but then the list will become too big if the ttl is too long, and if
ttl is too short I running the risk of having a empty list(if there is
no new activity).

Even if I don't use collection type and have my own table, I still ran
into the same issue.

Any recommendation to handle this type of situation?


View raw message