use MongoClient.is_mongos in ensure indexes #1759
This commit is contained in:
parent
a2d3bcd571
commit
257a43298b
@ -854,7 +854,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 not collection.database.client.is_mongos and collection.read_preference > 1:
|
||||||
return
|
return
|
||||||
|
|
||||||
# determine if an index which we are creating includes
|
# determine if an index which we are creating includes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user