Feature Request - Watches on hash keys.

526 views
Skip to first unread message

Brian Knox

unread,
Dec 9, 2010, 10:23:13 AM12/9/10
to redis-db
For some of the work we are doing, it would be extremely advantageous to be able to WATCH a key within a hash instead of watching the top level key that points to the entire hash.  So, I'm throwing this out as a feature desire to see if others would find this useful, and get a feel for how difficult the request is.

Thanks!
Brian

Jorge

unread,
Dec 28, 2010, 8:22:27 AM12/28/10
to Redis DB
+1 I could really use this feature too.

Use case:

I have a hash where keys are frequently being added and removed, but
existing keys do not change very often.
If I WATCH the top level key, then my MULTI/EXECs will fail
frequently, even though I am only interested in
updating an existing hash key in the hash.

The only workaround I can think of is to redundantly store the hash
keys as simple key-value pairs, and watch
these keys, but this is very wasteful in terms of memory.

Thanks,

Aaron

M Saleh D

unread,
Nov 13, 2021, 11:51:10 AM11/13/21
to Redis DB
I need it too. Very useful feature.

Cayo Souza

unread,
Mar 13, 2022, 7:06:44 AM3/13/22
to Redis DB
10 years later, is this a thing already?
Or is there another way of achieving the said result?
+1

Itamar Haber

unread,
Mar 13, 2022, 7:11:53 AM3/13/22
to Redis DB
This is not a Redis thing yet (although it may be in version gt 7.0).

It really depends on what you need to achieve and the use case. Some alternatives already exist, e.g. Keyspace Notifications, Client-Side Caching, and modules.

Cheers,
Itamar

Viktor Söderqvist

unread,
Mar 16, 2022, 5:15:38 AM3/16/22
to redi...@googlegroups.com
No, this is still not possible. Just like with expire per hash field,
the workaround is to store the fields as top-level keys instead.
> --
> You received this message because you are subscribed to the Google
> Groups "Redis DB" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to redis-db+u...@googlegroups.com
> <mailto:redis-db+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/redis-db/dee913f5-f3a5-4018-937e-f2cc1ddf6734n%40googlegroups.com
> <https://groups.google.com/d/msgid/redis-db/dee913f5-f3a5-4018-937e-f2cc1ddf6734n%40googlegroups.com?utm_medium=email&utm_source=footer>.
Reply all
Reply to author
Forward
0 new messages