Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cassandra - Cqlengine - TTL Support

I need to use TTL via cqlengine; But there is no documentation about it. Can someone help me about it. Thanks

like image 283
S.Mohamed Mahdi Ahmadian zadeh Avatar asked Sep 29 '13 11:09

S.Mohamed Mahdi Ahmadian zadeh


1 Answers

TTL is supported.

In [13]: class Bacon(Model):       
   ....:     pk = Integer(primary_key=True)
   ....:     name = Text()
   ....:     

In [14]: sync_table(Bacon)

In [15]: Bacon.ttl(60).create(pk=1, name="delicious")
Out[15]: Bacon <pk=1>

See the following:

  • https://cqlengine.readthedocs.org/en/latest/topics/queryset.html?highlight=ttl#cqlengine.query.QuerySet.ttl
  • https://cqlengine.readthedocs.org/en/latest/topics/models.html?highlight=ttl#cqlengine.models.Model.ttl
like image 157
Jon Haddad Avatar answered Oct 04 '22 19:10

Jon Haddad