HMSET

Syntax

  1. HMSET key field value [field value ...]

Time complexity: O(N) where N is the number of fields being set.

Sets the specified fields to their respective values in the hash stored at key. This command overwrites any specified fields already existing in the hash. If key does not exist, a new key holding a hash is created.

Return

Simple string reply

Examples

  1. dragonfly> HMSET myhash field1 "Hello" field2 "World"
  2. "OK"
  3. dragonfly> HGET myhash field1
  4. "Hello"
  5. dragonfly> HGET myhash field2
  6. "World"