Instantiates the MongoDB adapter with the default connection information.

Parameters

  • array $config All information required to connect to the database, including: - `'database'` _string_: The name of the database to connect to. Defaults to `null`. - `'host'` _string_: The IP or machine name where Mongo is running, followed by a colon, and the port number. Defaults to `'localhost:27017'`. - `'persistent'` _mixed_: Determines a persistent connection to attach to. See the `$options` parameter of [`Mongo::__construct()`](http://www.php.net/manual/en/mongo.construct.php) for more information. Defaults to `false`, meaning no persistent connection is made. - `'timeout'` _integer_: The number of milliseconds a connection attempt will wait before timing out and throwing an exception. Defaults to `100`. - `'schema'` _closure_: A closure or anonymous function which returns the schema information for a model class. See the `$_schema` property for more information. - `'gridPrefix'` _string_: The default prefix for MongoDB's `chunks` and `files` collections. Defaults to `'fs'`. - `'replicaSet'` _boolean_: See the documentation for `Mongo::__construct()`. Defaults to `false`. Typically, these parameters are set in `Connections::add()`, when adding the adapter to the list of active connections.

Source

						public function __construct(array $config = array()) {
		$defaults = array(
			'persistent' => false,
			'login'      => null,
			'password'   => null,
			'host'       => Mongo::DEFAULT_HOST . ':' . Mongo::DEFAULT_PORT,
			'database'   => null,
			'timeout'    => 100,
			'replicaSet' => false,
			'schema'     => null,
			'gridPrefix' => 'fs'
		);
		parent::__construct($config + $defaults);
	}