Redis HSET command is used to set field in the hash stored at the key to value. If the key does not exist, a new key holding a hash is created. If the field already exists in the hash, it is overwritten.
Following is the basic syntax of Redis HSET command.
redis 127.0.0.1:6379> HSET KEY_NAME FIELD VALUE
redis 127.0.0.1:6379> HSET myhash field1 "foo" OK redis 127.0.0.1:6379> HGET myhash field1 "foo"