@param string  $type The type of jobs to return. Might be `done` or `pending`. Example: 'pending'
@param integer $count
@param array   $options

@return \frankmayer\ArangoDbPhpCore\Protocols\Http\HttpResponse
765820
public function listJobResults($type, $count = null, array $options = [])
    {
        $urlQuery = null;

        /** @var AbstractHttpRequest $request */
        $request          = $this->getRequest();
        $request->options = $options;
        $request->path    = $this->client->fullDatabasePath . static::API_PATH . '/' . $type;
        $urlQueryStr      = '';

        if ($count) {
            $urlQuery    = ['count' => $count];
            $urlQueryStr = $request->buildUrlQuery($urlQuery);
        }

        $request->path .= $urlQueryStr;

        $request->method = static::METHOD_GET;

        return $this->getReturnObject($request);
    }
1001512
public function count($condition = [], $options = [])
    {
        return $this->database->createCommand()->count($this->name, $condition, $options);
    }
127490
protected function initService(string $type, string $alias, array $options)
    {
        $id      = $this->resolverFactory->resolve($type, $alias);
        $service = $this->get($id);
        
        $service->setOptions($options);
        
        return $service;
    }
252533
public List<JobInfo> findJobs(final Optional<String> type, final int count) {
        if (type.isPresent()) {
            return jobRepository.findLatestBy(type.get(), count);
        } else {
            return jobRepository.findLatest(count);
        }
    }
224886
protected function createForm($type, $data = null, array $options = array())
    {
        return $this->factory->create($type, $data, $options);
    }
525807
public static function count( $beanType, $addSQL = '', $params = array() ) {
		return RedBean_Facade::$redbean->count($beanType,$addSQL,$params);
	}
1018026
public function batchget($type = 'image', $offset = 0, $count = 20)
    {
        if (!is_string($type)) {
            $this->setError('参数错误,类型参数错误');

            return false;
        }

        $queryStr = [
            "type" => $type, 'offset' => $offset, 'count' => $count,
        ];

        $res = $this->_post('batchget_material', $queryStr);

        return $res;
    }
682248
public function select($type = null, $distinct = false)
    {
        $type = $this->createSelectData($type);

        if ($distinct === true) {
            $this->append('SELECT DISTINCT ' . $type);
        } else {
            $this->append('SELECT ' . $type);
        }

        // Save selected data (to be used when guessing count query)
        $this->selected = $type;
        return $this;
    }
1353367
public function chunk($callback, $count = 100)
    {
        if ($this->usePaginate) {
            return $this->buildData(false)->chunk($count)->each($callback);
        }

        $this->setSort();

        $this->queries->reject(function ($query) {
            return 'paginate' === $query['method'];
        })->each(function ($query) {
            $this->model = $this->model->{$query['method']}(...$query['arguments']);
        });

        return $this->model->chunk($count, $callback);
    }
104561
private function query($count)
    {
        $this->applyQueryFilters();

        if ($this->hasTranslating()) {
            $this->applyTranslationFilter();
        }

        if ($this->orderBy()) {
            $this->query = $this->query->orderBy(
                                $this->orderBy(),
                                $this->sortBy()
                            );
        }

        if ($count) {
            return $this->query->count();
        }

        if ($this->perPage > 0) {
            return $this->query->paginate($this->perPage);
        }

        return $this->query->get();
    }
798225
public function incrementAndInvoice($count = 1)
    {
        $this->incrementQuantity($count);

        $this->user->invoice(['subscription' => $this->stripe_id]);

        return $this;
    }
1066855
public function chunk($count, callable $callback)
    {
        $result = $this->getBuilder()->chunk($count, $callback);

        // Reset query builder
        $this->resetBuilder();

        return $result;
    }
1115477
private function _loadData($type, $count)
    {
        $data = $this->ShapeFile->readSHP($count);
        if ($data === false) {
            return false;
        }
        $this->read += strlen($data);

        return Util::loadData($type, $data);
    }
1294525
public function count($query = [], $options = [])
    {
        try {
            // Handle legacy mode - limit and skip as second and third parameters, respectively
            if (! is_array($options)) {
                $limit = $options;
                $options = [];

                if ($limit !== null) {
                    $options['limit'] = (int) $limit;
                }

                if (func_num_args() > 2) {
                    $options['skip'] = (int) func_get_args()[2];
                }
            }

            return $this->collection->count(TypeConverter::fromLegacy($query), $options);
        } catch (\MongoDB\Driver\Exception\Exception $e) {
            throw ExceptionConverter::toLegacy($e);
        }
    }
832347
private function createSessions($count)
    {
        $args = [
            'database' => $this->database->name(),
            'session' => [
                'labels' => isset($this->config['labels']) ? $this->config['labels'] : []
            ]
        ];

        $promises = [];

        for ($i = 0; $i < $count; $i++) {
            $promises[] = $this->database->connection()->createSessionAsync($args);
        }

        $results = Promise\settle($promises)->wait();

        $sessions = [];

        foreach ($results as $result) {
            if ($result['state'] === 'fulfilled') {
                $name = $result['value']->getName();
                $sessions[] = [
                    'name' => $name,
                    'expiration' => $this->time() + SessionPoolInterface::SESSION_EXPIRATION_SECONDS
                ];
            }
        }

        return $sessions;
    }
776536
private static function getQueriableResource($type, array $options = [])
    {
        if (!array_key_exists($type, self::$cache['resources']) || self::haveOptionsBeenUpdated($type, $options)) {
            self::$cache['options'][$type] = $options;
            self::$cache['resources'][$type] = new QueriableResource($type, $options);
        }
        return self::$cache['resources'][$type];
    }
1275973
static function make($type_uri, $count=1, $required=false,
                  $alias=null)
    {
        if ($alias !== null) {
            $result = Auth_OpenID_AX_checkAlias($alias);

            if (Auth_OpenID_AX::isError($result)) {
                return $result;
            }
        }

        return new Auth_OpenID_AX_AttrInfo($type_uri, $count, $required,
                                           $alias);
    }