diff --git a/src/Jenssegers/Mongodb/Connection.php b/src/Jenssegers/Mongodb/Connection.php index 52b024de4..526b26704 100644 --- a/src/Jenssegers/Mongodb/Connection.php +++ b/src/Jenssegers/Mongodb/Connection.php @@ -142,7 +142,15 @@ protected function createConnection($dsn, array $config, array $options) $options['password'] = $config['password']; } - return new MongoClient($dsn, $options); + // By default driver options is an empty array. + $driverOptions = array(); + + if (isset($config['driver_options']) && is_array($config['driver_options'])) + { + $driverOptions = $config['driver_options']; + } + + return new MongoClient($dsn, $options, $driverOptions); } /**