Skip to content

Instantly share code, notes, and snippets.

@tommoor
Last active December 11, 2015 10:29
Show Gist options
  • Save tommoor/4587122 to your computer and use it in GitHub Desktop.
Save tommoor/4587122 to your computer and use it in GitHub Desktop.
MongoDB persist issue in latest drivers, as this is using the Mongo class rather than MongoClient persist should be ignored rather than throw an exception.
<?php
try {
$connection = new Mongo("mongodb://localhost:27017", array('persist' => 'foo'));
} catch (MongoConnectionException $e) {
print_r($e->getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment