Skip to content

Commit

Permalink
Update comment concerning MongoDB versions
Browse files Browse the repository at this point in the history
  • Loading branch information
alcaeus committed May 17, 2016
1 parent d793ed3 commit 60e11cd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/Doctrine/ODM/MongoDB/SchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,7 @@ public function enableShardingForDbByDocumentName($documentName)
$adminDb = $this->dm->getConnection()->selectDatabase('admin');
$result = $adminDb->command(array('enableSharding' => $dbName));

// Different MongoDB versions return different result sets.
// Error code is only available with MongoDB 3.2. MongoDB 3.0 only returns a message
// Thus, check code if it exists and fall back on error message
if ($result['ok'] != 1 && ((isset($result['code']) && $result['code'] !== 23) && $result['errmsg'] !== 'already enabled')) {
throw MongoDBException::failedToEnableSharding($dbName, $result['errmsg']);
Expand Down

0 comments on commit 60e11cd

Please sign in to comment.