public function min($field) { $min = $this->cached('min' . $field . '.' . sha1(serialize($this->wheres))); if (!$min) { $collection = []; foreach ($this->cursor as $id) { $val = $this->store->hget('row.' . $id, $field); if ($val) { $add = ['id' => $id, $field => $val]; $collection[] = $add; } } $collection = new Collection($collection); $min = $collection->min($field); $this->setCached('min' . $field . '.' . sha1(serialize($this->wheres)), $min); } return $min; }