Cassandra - Cqlengine - TTL Support
Asked Answered
A

2

6

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

Adelaadelaida answered 29/9, 2013 at 11:11 Comment(0)
G
4

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:

Genip answered 16/7, 2014 at 14:35 Comment(0)
A
0

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

Ashes answered 21/1, 2018 at 7:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.