'Redis TYPE command of a hash return "none"

So I create a hash like the following.

> HSET test k "v" k1 "v1"
> HGETALL test
1) "k"
2) "v"
3) "k1"
4) "v1"

Now I expect the type of the value in the key test to be "hash", as according to the docs. https://redis.io/commands/type/

However what I receive is "none". Why is this?

> type test
none


Solution 1:[1]

my redis version is 2.8.24

use HMSET to set multi values.

127.0.0.1:6379> HMSET test k "v" k1 "v1"
OK
127.0.0.1:6379> HGETALL test
1) "k"
2) "v"
3) "k1"
4) "v1"
127.0.0.1:6379> type test
hash

my result is hash. maybe test was deleted after hset?

127.0.0.1:6379> del test
(integer) 1
127.0.0.1:6379> type test
none

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Renshaw