@@ -18,12 +18,13 @@ You can send comments, patches, questions [here on github](https://github.com/ni
18
18
* [ Connection] ( #connection )
19
19
* [ Server] ( #server )
20
20
* Keys and strings
21
- * Hashes
22
- * Lists
23
- * Sets
21
+ * [ Hashes] ( #hashes )
22
+ * [ Lists] ( #lists )
23
+ * [ Sets] ( #sets )
24
24
* [ Sorted sets] ( #sorted-sets )
25
25
* Pub/sub
26
26
* Transactions
27
+ * [ Scripting] ( #scripting )
27
28
28
29
-----
29
30
@@ -1621,6 +1622,66 @@ _**Description**_: A blocking version of `rpoplpush`, with an integral timeout i
1621
1622
* STRING* The element that was moved in case of success, ` FALSE ` in case of timeout.
1622
1623
1623
1624
1625
+ ### dump
1626
+ -----
1627
+ _ ** Description** _ : Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. The data
1628
+ that comes out of DUMP is a binary representation of the key as Redis stores it.
1629
+ ##### * Parameters*
1630
+ * key* string
1631
+ ##### * Return value*
1632
+ The Redis encoded value of the key, or FALSE if the key doesn't exist
1633
+ ##### * Examples*
1634
+ ~~~
1635
+ $redis->set('foo', 'bar');
1636
+ $val = $redis->dump('foo'); // $val will be the Redis encoded key value
1637
+ ~~~
1638
+
1639
+ ### restore
1640
+ -----
1641
+ _ ** Description** _ : Restore a key from the result of a DUMP operation.
1642
+ ##### * Parameters*
1643
+ * key* string. The key name
1644
+ * ttl* integer. How long the key should live (if zero, no expire will be set on the key)
1645
+ * value* string (binary). The Redis encoded key value (from DUMP)
1646
+ ##### * Examples*
1647
+ ~~~
1648
+ $redis->set('foo', 'bar');
1649
+ $val = $redis->dump('foo');
1650
+ $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
1651
+ ~~~
1652
+
1653
+ ### migrate
1654
+ -----
1655
+ _ ** Description** _ : Migrates a key to a different Redis instance.
1656
+ ##### * Parameters*
1657
+ * host* string. The destination host
1658
+ * port* integer. The TCP port to connect to.
1659
+ * key* string. The key to migrate.
1660
+ * destination-db* integer. The target DB.
1661
+ * timeout* integer. The maximum amount of time given to this transfer.
1662
+ ##### * Examples*
1663
+ ~~~
1664
+ $redis->migrate('backup', 6379, 'foo', 0, 3600);
1665
+ ~~~
1666
+
1667
+
1668
+
1669
+ ## Hashes
1670
+
1671
+ * [ hDel] ( #hdel ) - Delete one or more hash fields
1672
+ * [ hExists] ( #hexists ) - Determine if a hash field exists
1673
+ * [ hGet] ( #hget ) - Get the value of a hash field
1674
+ * [ hGetAll] ( #hgetall ) - Get all the fields and values in a hash
1675
+ * [ hIncrBy] ( #hincrby ) - Increment the integer value of a hash field by the given number
1676
+ * [ hIncrByFloat] ( #hincrbyfloat ) - Increment the float value of a hash field by the given amount
1677
+ * [ hKeys] ( #hkeys ) - Get all the fields in a hash
1678
+ * [ hLen] ( #hlen ) - Get the number of fields in a hash
1679
+ * [ hMGet] ( #hmget ) - Get the values of all the given hash fields
1680
+ * [ hMSet] ( #hmset ) - Set multiple hash fields to multiple values
1681
+ * [ hSet] ( #hset ) - Set the string value of a hash field
1682
+ * [ hSetNx] ( #hsetnx ) - Set the value of a hash field, only if the field does not exist
1683
+ * [ hVals] ( #hvals ) - Get all the values in a hash
1684
+
1624
1685
### hSet
1625
1686
-----
1626
1687
_ ** Description** _ : Adds a value to the hash stored at key. If this value is already in the hash, ` FALSE ` is returned.
@@ -1848,7 +1909,7 @@ $redis->hIncrByFLoat('h', 'x', 1.5); /* returns 3.0: h[x] = 3.0 now */
1848
1909
$redis->hIncrByFloat('h', 'x', -3.0); /* returns 0.0: h[x] = 0.0 now */
1849
1910
~~~
1850
1911
1851
- ### hMset
1912
+ ### hMSet
1852
1913
-----
1853
1914
_ ** Description** _ : Fills in a whole hash. Non-string values are converted to string, using the standard ` (string) ` cast. NULL values are stored as empty strings.
1854
1915
##### * Parameters*
@@ -1879,51 +1940,7 @@ $redis->hSet('h', 'field2', 'value2');
1879
1940
$redis->hmGet('h', array('field1', 'field2')); /* returns array('field1' => 'value1', 'field2' => 'value2') */
1880
1941
~~~
1881
1942
1882
- ### dump
1883
- -----
1884
- _ ** Description** _ : Dump a key out of a redis database, the value of which can later be passed into redis using the RESTORE command. The data
1885
- that comes out of DUMP is a binary representation of the key as Redis stores it.
1886
- ##### * Parameters*
1887
- * key* string
1888
- ##### * Return value*
1889
- The Redis encoded value of the key, or FALSE if the key doesn't exist
1890
- ##### * Examples*
1891
- ~~~
1892
- $redis->set('foo', 'bar');
1893
- $val = $redis->dump('foo'); // $val will be the Redis encoded key value
1894
- ~~~
1895
1943
1896
- ### restore
1897
- -----
1898
- _ ** Description** _ : Restore a key from the result of a DUMP operation.
1899
- ##### * Parameters*
1900
- * key* string. The key name
1901
- * ttl* integer. How long the key should live (if zero, no expire will be set on the key)
1902
- * value* string (binary). The Redis encoded key value (from DUMP)
1903
- ##### * Examples*
1904
- ~~~
1905
- $redis->set('foo', 'bar');
1906
- $val = $redis->dump('foo');
1907
- $redis->restore('bar', 0, $val); // The key 'bar', will now be equal to the key 'foo'
1908
- ~~~
1909
-
1910
- ### migrate
1911
- -----
1912
- _ ** Description** _ : Migrates a key to a different Redis instance.
1913
- ##### * Parameters*
1914
- * host* string. The destination host
1915
- * port* integer. The TCP port to connect to.
1916
- * key* string. The key to migrate.
1917
- * destination-db* integer. The target DB.
1918
- * timeout* integer. The maximum amount of time given to this transfer.
1919
- ##### * Examples*
1920
- ~~~
1921
- $redis->migrate('backup', 6379, 'foo', 0, 3600);
1922
- ~~~
1923
-
1924
-
1925
-
1926
- ## Hashes
1927
1944
1928
1945
## Lists
1929
1946
0 commit comments