在Predis中使用hmset的问题

aie*_*ven 2 php redis predis

我有使用问题$predis->hmset().我需要使用哪些参数?我尝试了很多变种,但没有成功.

$this->client()->hmset( $this->name, array( 1 => 3 ))

$this->client()->hmset( $this->name, array( 1, 3 ))
Run Code Online (Sandbox Code Playgroud)

Did*_*zia 10

predis例子:

// Prepare an hash with some fields and their respective values.
$client->hmset('metavars', array('foo' => 'bar', 'hoge' => 'piyo', 'lol' => 'wut'));
Run Code Online (Sandbox Code Playgroud)

也许,确保你使用字符串而不是整数...