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 @@ -617,15 +617,14 @@ def is_mongodb_6_3(self):
617
617
def supports_search_indexes (self ):
618
618
dummy_collection = "__null"
619
619
try :
620
- # Try to execute an search indexes operation over an existing collection.
620
+ # Create or get dummy collection.
621
621
try :
622
622
collection = self .connection .database .create_collection (dummy_collection )
623
623
except CollectionInvalid :
624
- # If the collection exists, it will be removed after this operation.
625
624
collection = self .connection .get_collection (dummy_collection )
625
+ # Check search indexes support (raises if unsupported).
626
626
collection .list_search_indexes ()
627
627
except OperationFailure :
628
- # Operation fails then search indexes isn't supported.
629
628
return False
630
629
else :
631
630
return True
You can’t perform that action at this time.
0 commit comments