企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
## hSet ##### *Description* Adds a value to the hash stored at key. If this value is already in the hash, `<span class="calibre12">FALSE</span>` is returned. 添加一个VALUE到HASH中。如果VALUE已经存在于HASH中,则返回FALSE。 ##### *Parameters* *key* *hashKey* *value* ##### *Return value* *LONG*`<span class="calibre12">1</span>` if value didn't exist and was added successfully, `<span class="calibre12">0</span>` if the value was already present and was replaced, `<span class="calibre12">FALSE</span>` if there was an error. ##### *Example* ``` <pre class="calibre9">$redis->delete('h') $redis->hSet('h', 'key1', 'hello'); /* 1, 'key1' => 'hello' in the hash at "h" */ $redis->hGet('h', 'key1'); /* returns "hello" */ $redis->hSet('h', 'key1', 'plop'); /* 0, value was replaced. */ $redis->hGet('h', 'key1'); /* returns "plop" */ ``` ##