Skip to content

HKEYS returns empty hash in RESP3 [BUG] #7776

@Harrison88

Description

@Harrison88

Describe the bug

When using RESP 3, the HKEYS command returns an empty hash when a key doesn't exist, but an array when it does exist.

To reproduce

Using redis-cli:

127.0.0.1:6379> HELLO 3
1# "server" => "redis"
2# "version" => "6.0.5"
3# "proto" => (integer) 3
4# "id" => (integer) 4
5# "mode" => "standalone"
6# "role" => "master"
7# "modules" => (empty array)
127.0.0.1:6379> HKEYS test_nonexistent_key
(empty hash)

Expected behavior

I expected the return type to be consistent with the type received when the key does exist (array). Although, I also think that a set might be more appropriate as a return type here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions