We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e8e47c3 commit 8739ab9Copy full SHA for 8739ab9
mongoengine/document.py
@@ -196,6 +196,7 @@ def _get_collection(cls):
196
# Ensure indexes on the collection unless auto_create_index was
197
# set to False.
198
# Also there is no need to ensure indexes on slave.
199
+ db = cls._get_db()
200
if cls._meta.get('auto_create_index', True) and\
201
db.client.is_primary:
202
cls.ensure_indexes()
0 commit comments