Redis can be used either directly as a key-value store, where the value is string. Or, in more sophisticated way, the value can be a data structure, for example hash or list. Assuming we have the second case and under the key "H", there is a hash. Items can be added to the hash and removed. Eventually, the hash can be empty, and it can be re-populated again.
I have found out that if we remove the last item from the data structure, our hash "H", Redis removes it from current keys, for some reason.
Example:
HSET "H" "key1" "value1"
HSET "H" "key2" "value2"
HDEL "H" "key1"
<-- Here, "H" is in the list of current keys, whereby HLEN returns 1
HDEL "H" "key2"
<-- Here, for some reason, "H" is not shown among existing keys,
not even as an empty hash (HLEN 0)
HSET "H" "key3" "value3"
<-- Hash is back in the list of keys
My question is: Is it possible to configure Redis so it does still keep showing the value (empty hash, in our example) of the given key ("H", in our example) as an empty non-trivial data structure?