Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpredis/phpredis.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Favre-Felix <n.favrefelix@gmail.com>2010-03-15 14:15:48 +0300
committerNicolas Favre-Felix <n.favrefelix@gmail.com>2010-03-15 14:15:48 +0300
commit7f653b81a325dcf21699e42ecd62d010e870c715 (patch)
treeb17549cc24adcc05ac9f644bb97b0741b0491ce7 /README.markdown
parente5e1e705a48afcea8a794866114dfa6da5c58c20 (diff)
Added hGet/hSet + tests & documentation.
Diffstat (limited to 'README.markdown')
-rw-r--r--README.markdown32
1 files changed, 32 insertions, 0 deletions
diff --git a/README.markdown b/README.markdown
index 32be01c3..2b415e04 100644
--- a/README.markdown
+++ b/README.markdown
@@ -1296,3 +1296,35 @@ $redis->zIncrBy('key', 2.5, 'member1'); /* key or member1 didn't exist, so membe
/* and now has the value 2.5 */
$redis->zIncrBy('key', 1, 'member1'); /* 3.5 */
</pre>
+
+
+## hSet
+##### *Description*
+Adds a value to the hash stored at key. If this value is already in the hash, `FALSE` is returned.
+##### *Parameters*
+*key*
+*hashKey*
+*value*
+
+##### *Return value*
+*LONG* `TRUE` if value didn't exist and was added successfully, `FALSE` if the value was already present and was replaced.
+##### *Example*
+<pre>
+$redis->delete('h')
+$redis->hSet('h', 'key1', 'hello'); /* TRUE, 'key1' => 'hello' in the hash at "h" */
+$redis->hGet('h', 'key1'); /* returns "hello" */
+
+$redis->hSet('h', 'key1', 'plop'); /* FALSE, value was replaced. */
+$redis->hGet('h', 'key1'); /* returns "plop" */
+</pre>
+
+## hGet
+##### *Description*
+Gets a value from the hash stored at key. If the hash table doesn't exist, or the key doesn't exist, `FALSE` is returned.
+##### *Parameters*
+*key*
+*hashKey*
+
+##### *Return value*
+*STRING* The value, if the command executed successfully
+*BOOL* `FALSE` in case of failure (empty list)