Slide 44
Slide 44 text
Hashes
'127.0.0.1','port'=> 6379,'data
base' => 0);
$client = new Predis\Client($server);
$client->flushdb();
$client->hset('hash1', 'name', 'Name for hash1');
$client->hmset('hash1', 'id', 1, 'status','ok');
$client->hset('hash2', 'name', 'Name for hash2');
$client->hsetnx('hash2', 'id', 1);
$client->hincrby('hash3','id',1);
$client->hset('hash2', 'bla', 'bla');
$client->hdel('hash2','bla');
var_dump(
$client->hexists('hash1','id'),
$client->hget('hash1','id'),
$client->hgetall('hash1'),
$client->hkeys('hash2'),
$client->hvals('hash2'),
$client->hlen('hash2'),
$client->hmget('hash1','id','name')
);