0

Is there any possibility to set Different Expiry Time(TTL) for each Hash Fields in HashSet like below Under HashKey name "SampleHasSet"

              | Key      |   Value       |   TTL     |
              |-----     | ------------  | --------  |
              | Key1     |  Key1Value    |  100      |
              | Key2     |  Key2Value    |  200      |
Satya M
  • 29
  • 8
  • 1
    Redis doesn't support something like that. So the doesn't the library. Related [to](https://stackoverflow.com/questions/16545321/how-to-expire-the-hset-child-key-in-redis) – Eldar Oct 10 '22 at 06:52
  • 1
    As @Eldar says; the library is an API around the server features, and the **server** doesn't offer this capability. It *can* be kinda sorta hacked into values manually as a workaround, but: the server won't do any cleanup and HEXISTS etc will report incorrectly. Alternatively, you could use key-per-value, but then you lose things like HGETALL/HSCAN or atomic delete of the entire chunk – Marc Gravell Oct 10 '22 at 08:00

0 Answers0