Mongolid\Connection\Connection::__construct PHP Method

__construct() public method

Constructs a new Mongolid connection. It uses the same constructor parameters as the original MongoDB\Client constructor.
See also: http://php.net/manual/en/mongodb-driver-manager.construct.php
public __construct ( string $server = 'mongodb://localhost:27017', array $options = ['connect' => true], array $driver_options = [] )
$server string The specified connection string.
$options array The mongodb client options.
$driver_options array The mongodb driver options when opening a connection.
    public function __construct(string $server = 'mongodb://localhost:27017', array $options = ['connect' => true], array $driver_options = [])
    {
        // In order to work with PHP arrays instead of with objects
        $driver_options['typeMap'] = ['array' => 'array', 'document' => 'array'];
        $this->findDefaultDatabase($server);
        $parameters = [$server, $options, $driver_options];
        $this->rawManager = Ioc::make(Manager::class, $parameters);
        $this->rawConnection = Ioc::make(Client::class, $parameters);
    }