Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 328f599

Browse files
author
Tit Petric
committed
moved hash methods under heading, created toc
1 parent a6a51a9 commit 328f599

File tree

1 file changed

+65
-48
lines changed

1 file changed

+65
-48
lines changed

README.markdown

Lines changed: 65 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,13 @@ You can send comments, patches, questions [here on github](https://github.com/ni
1818
* [Connection](#connection)
1919
* [Server](#server)
2020
* Keys and strings
21-
* Hashes
22-
* Lists
23-
* Sets
21+
* [Hashes](#hashes)
22+
* [Lists](#lists)
23+
* [Sets](#sets)
2424
* [Sorted sets](#sorted-sets)
2525
* Pub/sub
2626
* Transactions
27+
* [Scripting](#scripting)
2728

2829
-----
2930

@@ -1621,6 +1622,66 @@ _**Description**_: A blocking version of `rpoplpush`, with an integral timeout i
16211622
*STRING* The element that was moved in case of success, `FALSE` in case of timeout.
16221623

16231624

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+
16241685
### hSet
16251686
-----
16261687
_**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 */
18481909
$redis->hIncrByFloat('h', 'x', -3.0); /* returns 0.0: h[x] = 0.0 now */
18491910
~~~
18501911

1851-
### hMset
1912+
### hMSet
18521913
-----
18531914
_**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.
18541915
##### *Parameters*
@@ -1879,51 +1940,7 @@ $redis->hSet('h', 'field2', 'value2');
18791940
$redis->hmGet('h', array('field1', 'field2')); /* returns array('field1' => 'value1', 'field2' => 'value2') */
18801941
~~~
18811942

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-
~~~
18951943

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
19271944

19281945
## Lists
19291946

0 commit comments

Comments
 (0)