Hashes Hmset
# Redis Hmset Command
[!(#) Redis Hashes](#)
The Redis Hmset command is used to simultaneously set multiple field-value pairs into a hash.
This command overwrites existing fields in the hash.
If the hash does not exist, a new empty hash is created and the HMSET operation is performed.
### Syntax
The basic syntax of the redis Hmset command is as follows:
redis 127.0.0.1:6379> HMSET KEY_NAME FIELD1 VALUE1 ...FIELDN VALUEN
### Available Version
>= 2.0.0
### Return Value
Returns OK if the command executes successfully.
### Example
redis 127.0.0.1:6379> HMSET myhash field1 "Hello" field2 "World" OK redis 127.0.0.1:6379> HGET myhash field1 "Hello" redis 127.0.0.1:6379> HGET myhash field2 "World"
[!(#) Redis Hashes](#)
YouTip