Skip to content

Commit d30ab34

Browse files
committed
Add details on error codes
1 parent 5700592 commit d30ab34

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Schema/Builder.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,12 @@ protected function getAllCollections()
319319
/** @internal */
320320
public static function isAtlasSearchNotSupportedException(ServerException $e): bool
321321
{
322-
return in_array($e->getCode(), [59, 40324, 115, 6047401, 31082], true);
322+
return in_array($e->getCode(), [
323+
59, // MongoDB 4 to 6, 7-community: no such command: 'createSearchIndexes'
324+
40324, // MongoDB 4 to 6: Unrecognized pipeline stage name: '$listSearchIndexes'
325+
115, // MongoDB 7-ent: Search index commands are only supported with Atlas.
326+
6047401, // MongoDB 7: $listSearchIndexes stage is only allowed on MongoDB Atlas
327+
31082, // MongoDB 8: Using Atlas Search Database Commands and the $listSearchIndexes aggregation stage requires additional configuration.
328+
], true);
323329
}
324330
}

0 commit comments

Comments
 (0)