Skip to content

Commit 61b1c05

Browse files
committed
Edits
1 parent 82f3d1c commit 61b1c05

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

django_mongodb_backend/features.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -617,15 +617,14 @@ def is_mongodb_6_3(self):
617617
def supports_search_indexes(self):
618618
dummy_collection = "__null"
619619
try:
620-
# Try to execute an search indexes operation over an existing collection.
620+
# Create or get dummy collection.
621621
try:
622622
collection = self.connection.database.create_collection(dummy_collection)
623623
except CollectionInvalid:
624-
# If the collection exists, it will be removed after this operation.
625624
collection = self.connection.get_collection(dummy_collection)
625+
# Check search indexes support (raises if unsupported).
626626
collection.list_search_indexes()
627627
except OperationFailure:
628-
# Operation fails then search indexes isn't supported.
629628
return False
630629
else:
631630
return True

0 commit comments

Comments
 (0)