Phalcon\Db\Adapter\MongoDB\Database::createCollection PHP Method

createCollection() public method

Create a new collection explicitly.
See also: CreateCollection::__construct() for supported options
public createCollection ( string $collectionName, array $options = [] ) : array | object
$collectionName string
$options array
return array | object Command result document
    public function createCollection($collectionName, array $options = [])
    {
        if (!isset($options['typeMap'])) {
            $options['typeMap'] = $this->typeMap;
        }
        $operation = new CreateCollection($this->databaseName, $collectionName, $options);
        $server = $this->manager->selectServer(new ReadPreference(ReadPreference::RP_PRIMARY));
        return $operation->execute($server);
    }