Mhset
Bun

method

RedisClient.hset

key: KeyLike,
fields: Record<string | number, number | KeyLike>
): Promise<number>;

Set the value of a hash field or multiple fields

@param key

The hash key

@param fields

Object/Record with field-value pairs

@returns

Promise that resolves with the number of fields that were added

key: KeyLike,
field: KeyLike,
value: KeyLike,
...rest: KeyLike[]
): Promise<number>;

Set the value of a hash field or multiple fields (variadic)

@param key

The hash key

@param field

The field name

@param value

The value to set

@param rest

Additional field-value pairs

@returns

Promise that resolves with the number of fields that were added

Referenced types

type KeyLike = string | ArrayBufferView | Blob