Skip to content

Commit

Permalink
Merge pull request #2675 from doctrine/2.8.x-merge-up-into-2.9.x_gy9c…
Browse files Browse the repository at this point in the history
…DuHl

Merge release 2.8.2 into 2.9.x
  • Loading branch information
alcaeus committed Sep 6, 2024
2 parents 93b9374 + 6dffe12 commit 8e0deb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Doctrine/ODM/MongoDB/SchemaManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -1062,6 +1062,11 @@ private function isSearchIndexCommandException(CommandException $e): bool
return true;
}

// MongoDB 6.0.7+ and 7.0+: "$listSearchIndexes stage is only allowed on MongoDB Atlas"
if ($e->getMessage() === '$listSearchIndexes stage is only allowed on MongoDB Atlas') {
return true;
}

// Older server versions don't support $listSearchIndexes
// We don't check for an error code here as the code is not documented and we can't rely on it
return str_contains($e->getMessage(), 'Unrecognized pipeline stage name: \'$listSearchIndexes\'');
Expand Down

0 comments on commit 8e0deb1

Please sign in to comment.