The problem/use-case that the feature addresses

Distinguish between update and insert events

Description of the feature

We need a new feature that we can use to separate set and update events. Is there this feature in redis?

Alternatives you've considered

One idea is that when we use hset for example. If there is a key, consider this operation as an update and send a phrase like uhset instead of hset.

for example in hsetCommand function

    if (update)
        notifyKeyspaceEvent(NOTIFY_HASH,"uhset",c->argv[1],c->db->id);
    else
        notifyKeyspaceEvent(NOTIFY_HASH,"hset",c->argv[1],c->db->id);

What do you think about this method?

Comment From: itamarhaber

Hello @mmhatami

To clarify, it looks like this discussion is specifically about Keyspace Notifications. Furthermore, I assume you want these events for each data type. If that is the case, have you considered using the m flag that generates "key miss" events? It could be a sort of substitute for the "insert" event.

That said, adding the suggested "insert/update" event per type would double the amount of generated events. Alternatively, we could (not!) break compatibility by changing the event's payload. Either way, it doesn't sound promising.

Another possible alternative, but this really depends on the why the OP has opted for keyspace notifications in the first place, is using a form of Client-Side Caching - perhaps augmented by some sketch in the client - to manage this type of "monitoring" on keys.