Phalcon\Db\Adapter\MongoDB\Operation\Count::createCommand PHP Méthode

createCommand() private méthode

Create the count command.
private createCommand ( MongoDB\Driver\Server $server ) : MongoDB\Driver\Command
$server MongoDB\Driver\Server
Résultat MongoDB\Driver\Command
    private function createCommand(Server $server)
    {
        $cmd = ['count' => $this->collectionName];
        if (!empty($this->filter)) {
            $cmd['query'] = (object) $this->filter;
        }
        foreach (['hint', 'limit', 'maxTimeMS', 'skip'] as $option) {
            if (isset($this->options[$option])) {
                $cmd[$option] = $this->options[$option];
            }
        }
        if (isset($this->options['readConcern']) && Functions::serverSupportsFeature($server, self::$wireVersionForReadConcern)) {
            $cmd['readConcern'] = Functions::readConcernAsDocument($this->options['readConcern']);
        }
        return new Command($cmd);
    }