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.
2 parents 4567887 + f81e88e commit 8ea77fcCopy full SHA for 8ea77fc
docs/guide/connecting.rst
@@ -186,6 +186,10 @@ access to the same User document across databases::
186
with switch_db(User, 'archive-user-db') as User:
187
User(name='Ross').save() # Saves the 'archive-user-db'
188
189
+.. note:: :func:`~mongoengine.context_managers.switch_db` when used on
190
+ a class that allow inheritance will change the database alias
191
+ for instances of a given class only - instances of subclasses will still use
192
+ the default database.
193
194
Switch Collection
195
-----------------
0 commit comments