We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 82f3d1c commit 61b1c05Copy full SHA for 61b1c05
django_mongodb_backend/features.py
@@ -617,15 +617,14 @@ def is_mongodb_6_3(self):
617
def supports_search_indexes(self):
618
dummy_collection = "__null"
619
try:
620
- # Try to execute an search indexes operation over an existing collection.
+ # Create or get dummy collection.
621
622
collection = self.connection.database.create_collection(dummy_collection)
623
except CollectionInvalid:
624
- # If the collection exists, it will be removed after this operation.
625
collection = self.connection.get_collection(dummy_collection)
+ # Check search indexes support (raises if unsupported).
626
collection.list_search_indexes()
627
except OperationFailure:
628
- # Operation fails then search indexes isn't supported.
629
return False
630
else:
631
return True
0 commit comments