Quantcast
Channel: How to "EXPIRE" the "HSET" child key in redis? - Stack Overflow
Browsing latest articles
Browse All 16 View Live

Answer by MikeZ for How to "EXPIRE" the "HSET" child key in redis?

We had the same problem discussed here. We have a Redis hash, a key to hash entries (name/value pairs), and we needed to hold individual expiration times on each hash entry. We implemented this by...

View Article



Answer by hveiga for How to "EXPIRE" the "HSET" child key in redis?

Redis does not support having TTL on hashes other than the top key, which would expire the whole hash. If you are using a sharded cluster, there is another approach you could use. This approach could...

View Article

Answer by mojians for How to "EXPIRE" the "HSET" child key in redis?

You can use Sorted Set in redis to get a TTL container with timestamp as score. For example, whenever you insert a event string into the set you can set its score to the event time. Thus you can get...

View Article

Answer by user4167123 for How to "EXPIRE" the "HSET" child key in redis?

You could use the Redis Keyspace Notifications by using psubscribe and "__keyevent@<DB-INDEX>__:expired". With that, each time that a key will expire, you will get a message published on your...

View Article

Answer by Muhammad Soliman for How to "EXPIRE" the "HSET" child key in redis?

You could store key/values in Redis differently to achieve this, by just adding a prefix or namespace to your keys when you store them e.g. "hset_" Get a key/value GET hset_key equals to HGET hset key...

View Article


Answer by George I. Tsopouridis for How to "EXPIRE" the "HSET" child key in...

Regarding a NodeJS implementation, I have added a custom expiryTime field in the object I save in the HASH. Then after a specific period time, I clear the expired HASH entries by using the following...

View Article

Answer by Nikita Koksharov for How to "EXPIRE" the "HSET" child key in redis?

There is a Redisson java framework which implements hash Map object with entry TTL support. It uses hmap and zset Redis objects under the hood. Usage example: RMapCache<Integer, String> map =...

View Article

Answer by Jonathan Kim for How to "EXPIRE" the "HSET" child key in redis?

You can. Here is an example. redis 127.0.0.1:6379> hset key f1 1 (integer) 1 redis 127.0.0.1:6379> hset key f2 2 (integer) 1 redis 127.0.0.1:6379> hvals key 1) "1" 2) "1" 3) "2" redis...

View Article


Answer by Supr for How to "EXPIRE" the "HSET" child key in redis?

This is not possible, for the sake of keeping Redis simple. Quoth Antirez, creator of Redis: Hi, it is not possible, either use a different top-level key for that specific field, or store along with...

View Article


How to "EXPIRE" the "HSET" child key in redis?

I need to expire all keys in redis hash, which are older then 1 month.

View Article

Answer by John Sully for How to "EXPIRE" the "HSET" child key in redis?

This is possible in KeyDB which is a Fork of Redis. Because it's a Fork its fully compatible with Redis and works as a drop in replacement.Just use the EXPIREMEMBER command. It works with sets, hashes,...

View Article

Answer by rococo for How to "EXPIRE" the "HSET" child key in redis?

If your use-case is that you're caching values in Redis and are tolerant of stale values but would like to refresh them occasionally so that they don't get too stale, a hacky workaround is to just...

View Article

Answer by schn ran for How to "EXPIRE" the "HSET" child key in redis?

static async setCount(ip: string, count: number) { const val = await redisClient.hSet(ip, 'ipHashField', count) await redisClient.expire(ip, this.expireTime) }Try expire your key.

View Article


Answer by JemmyJonFlutter2 for How to "EXPIRE" the "HSET" child key in redis?

Elon Musk will soon send people to the moon and we still cannot expire fields on redis :(Anyway the solution I've been come up with is:Lets say I want to expire every 3 minutes:So im holding the data...

View Article

Answer by RushPL for How to "EXPIRE" the "HSET" child key in redis?

I created a Redis module in Rust that implements an EXPIREMEMBER command https://github.com/Rush/redis_expiremember_moduleIt is not as sophisticated as the implementation in KeyDB but was designed for...

View Article

Browsing latest articles
Browse All 16 View Live




Latest Images