Available since 2.0.0.

HGETALL key

Returns all fields and values of the hash stored at key. In the returned value, every field name is followed by its value, so the length of the reply is twice the size of the hash.

Return value

Array reply: list of fields and their values stored in the hash, or an empty list when key does not exist.

Examples

redis> HSET myhash field1 "Hello"
(integer) 1
redis> HSET myhash field2 "World"
(integer) 1
redis> HGETALL myhash
1) "field1"
2) "Hello"
3) "field2"
4) "World"
redis>

Hierarchy

Constructors

Properties

DbDataType: DataType = DataType.HASH
blocking?: boolean
dataType?: DataType

Used for "database" commands to enforce type checking.

logger: Logger = ...
maxParams: number = 1

Maximum number of parameters allowed. -1 for no maximum.

minParams: number = 1

Minimum number of parameters require.

name: string = "hgetall"
pubSubAllowed?: boolean

Used when PUB/SUB is in effect.

sign?: number

Sign is used in commands with a compliment command. The only current example is INCR/DECR. Sign is 1 for INCR and -1 for DECR

txIgnore?: boolean

Used in transactions to enqueue a command.

Methods