feat: update code collection check

This commit is contained in:
Georg K 2022-02-03 20:16:03 +03:00
parent dffcc0992d
commit f5fec0f374

View File

@ -808,7 +808,7 @@ class Document(BaseDocument):
collection = cls._get_collection() collection = cls._get_collection()
# 746: when connection is via mongos, the read preference is not necessarily an indication that # 746: when connection is via mongos, the read preference is not necessarily an indication that
# this code runs on a secondary # this code runs on a secondary
if not collection.is_mongos and collection.read_preference > 1: if collection.is_mongos is not None and collection.read_preference.mode > 1:
return return
# determine if an index which we are creating includes # determine if an index which we are creating includes