为什么 Laravel 中 Redis 的 hmget 操作返回使用 array_values 过滤?
为什么laravel中Redis的hmget操作返回使用array_values过滤?
/**
* Get the value of the given hash fields.
*
* @param string $key
* @param dynamic $dictionary
* @return int
*/
public function hmget($key, ...$dictionary)
{
if (count($dictionary) == 1) {
$dictionary = $dictionary[0];
}
return array_values($this->command('hmget', [$key, $dictionary]));
}
这样的话我查询出来的数组就没有和value相对应的key了,laravel这样做的原因是什么?可以把array_values去掉吗?或者有什么其他更好的解决方法?
推荐文章: