easy-swoole / easyswoole

swoole,easyswoole,swoole framework
https://www.easyswoole.com/
Apache License 2.0
4.74k stars 511 forks source link

redis hMGet 和预期不一样 #480

Closed Sgenmi closed 3 years ago

Sgenmi commented 3 years ago
$field=[
   'id','name','age'
];
$key='h:user:1';
$res = $redis->hMget($key,$field)

预期res结果:

   $res=[
     'id'=>xxx,
     'name'=xxx,
     'age'=>'xxx'
   ];

现,实际结果为:

  $res=[
   0=>xxx,
   1=>xxx,
   2=>xxx
 ];

hgetall可以返回预期结果,如果这个hash的key 比较多,感觉有点不妥。

希望和预期结果一样。符合phpredis返回结果

Player626 commented 3 years ago

@tioncico

tioncico commented 3 years ago

https://github.com/easy-swoole/redis/releases/tag/1.3.10