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

Upvotes: 6

Views: 546

Answers (2)

Thomas John
Thomas John

Reputation: 2188

Tried this, But wont work,

Bacon.create(pk=1, name="delicious").ttl(60)

This will work perfectly

Bacon.ttl(60).create(pk=1, name="delicious")

Use ttl() before create(), works well in Django

Upvotes: 0

Jon Haddad
Jon Haddad

Reputation: 766

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:

Upvotes: 4

Related Questions