public function length($key, $type = null)
	{
		if (is_null($type)) $type = $this->type($key);

		switch ($type)
		{
			case 'list':
				return $this->database->llen($key);

			case 'zset':
				return $this->database->zcard($key);

			default:
				throw new UnexpectedValueException("List type '{$type}' not supported.");
		}
	}