Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading