1

I am using redis graph in my django project to save huge number of data nodes. I am not able to set the expire time of these nodes so the redis data keeps on increasing. I do not want to set a TTL in configuration as different nodes can have different TTL. I am using django-redis==5.2.0 for intereacting with redis from django.

Also i am mostly using raw graph query to save data in redis graph like "CREATE (n:label {a:1}) RETURN n" , so if there is a parameter which i can set here to set TTL it will be helpful.

1 Answers1

2

Setting a TTL in Redis is something that is done only at the key level—typically using the EXPIRE command. Since a graph in RedisGraph is stored entirely in a single key, you can't set a TTL for nodes and edges within that key. Only for the key itself (i.e. the entire graph).

This is comparable to the way that you can't set a TTL on members of a Set, fields in a Hash, of items in a List.

If you need to trim your graph periodically, you'll need to write code to do it.

Guy Royse
  • 2,739
  • 12
  • 9