File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -554,15 +554,14 @@ def is_mongodb_6_3(self):
554
554
def supports_search_indexes (self ):
555
555
dummy_collection = "__null"
556
556
try :
557
- # Try to execute an search indexes operation over an existing collection.
557
+ # Create or get dummy collection.
558
558
try :
559
559
collection = self .connection .database .create_collection (dummy_collection )
560
560
except CollectionInvalid :
561
- # If the collection exists, it will be removed after this operation.
562
561
collection = self .connection .get_collection (dummy_collection )
562
+ # Check search indexes support (raises if unsupported).
563
563
collection .list_search_indexes ()
564
564
except OperationFailure :
565
- # Operation fails then search indexes isn't supported.
566
565
return False
567
566
else :
568
567
return True
You can’t perform that action at this time.
0 commit comments