docs/content/stable/yedis/api/hset.md
HSET key field value
This command sets the data for the given field of the hash that is associated with the given key with the given value. If the field already exists in the hash, it is overwritten.
key does not exist, an associated hash is created, and the field and value are inserted.key is not associated with a hash, an error is raised.Depends on the configuration parameter emulate_redis_responses.
emulate_redis_responses is true, returns 1 if a new field is inserted and 0 if an existing field is updated.emulate_redis_responses is false, returns OKemulate_redis_responses is true.
$ HSET yugahash area1 "America"
1
$ HSET yugahash area1 "North America"
0
$ HGET yugahash area1
"North America"
emulate_redis_responses is false.
$ HSET yugahash area1 "America"
"OK"
$ HSET yugahash area1 "North America"
"OK"
$ HGET yugahash area1
"North America"
hdel, hexists, hget, hgetall, hincrby, hkeys, hlen, hmget, hmset, hstrlen, hvals