Skip to content

Commit d50af87

Browse files
committed
add note about connect=False to docs
thanks @hbldh for reminding me of this!
1 parent 5c48b47 commit d50af87

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

docs/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,15 @@ You may also pass additional keyword arguments to the ``PyMongo``
8989
constructor. These are passed directly through to the underlying
9090
:class:`~pymongo.mongo_client.MongoClient` object.
9191

92+
.. note::
93+
94+
Unless you specify otherwise, PyMongo will attempt to connect to your
95+
MongoDB server immediately (within the call to :meth:`init_app` in the
96+
case of Flask-PyMongo). If the web server you are running Flask in loads
97+
your application before forking, you may experience problems. In these
98+
cases, you are advised to pass ``connect=False`` to ``PyMongo``, or
99+
append ``?connect=false`` to your MongoDB URI.
100+
92101
You can create multiple ``PyMongo`` instances, to connect to multiple
93102
databases or database servers:
94103

0 commit comments

Comments
 (0)