You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -38,14 +38,14 @@ To install this package simply use pip::
38
38
Support / Feedback
39
39
==================
40
40
41
-
For questions, discussions, or general technical support, visit the MongoDB Community Forums.
41
+
For questions, discussions, or general technical support, visit the `MongoDB Community Forums<https://developer.mongodb.com/community/forums/tag/python>`_.
42
42
The MongoDB Community Forums are a centralized place to connect with other MongoDB users, ask questions, and get answers.
43
43
44
44
Bugs / Feature Requests
45
45
=======================
46
46
47
47
Think you’ve found a bug? Want to see a new feature in PyMongoExplain?
48
-
Please open an issue on this GitHub repository.
48
+
Please open an issue on this `GitHub repository<https://github.com/mongodb-labs/pymongoexplain>`_.
49
49
50
50
How To Ask For Help
51
51
-------------------
@@ -82,14 +82,16 @@ the root of the distribution.
82
82
Tutorial
83
83
========
84
84
85
-
PyMongo operations in existing application code can be explained by swapping ``Collection`` objects with ``ExplainCollection``
86
-
objects. The ``ExplainCollection`` class provides all CRUD API methods provided by PyMongo's ``Collection``,
85
+
PyMongo operations in existing application code can be explained by swapping ``Collection`` objects with ``ExplainableCollection``
86
+
objects. The ``ExplainableCollection`` class provides all CRUD API methods provided by PyMongo's ``Collection``,
87
87
but using this class to run operations runs explain on them, instead of executing them.
88
88
89
-
To run explain on a command, first instantiate an ``ExplainCollection`` from the ``Collection`` object originally used to run the command::
89
+
To run explain on a command, first instantiate an ``ExplainableCollection`` from the ``Collection`` object originally used to run the command::
90
+
91
+
from pymongoexplain import ExplainableCollection
90
92
91
93
collection = client.db.products
92
-
explain = ExplainCollection(collection)
94
+
explain = ExplainableCollection(collection)
93
95
94
96
Now you are ready to explain some commands. Remember that explaining a command does not execute it::
95
97
@@ -118,7 +120,7 @@ Now ``result`` will contain the output of running explain on the given ``update_
118
120
'version': '4.4.0-rc13'}}
119
121
120
122
121
-
Since ``ExplainCollection`` instances provide all the same methods provided by ``Collection`` instances, explaining operations in your application code is a simple matter of replacing ``Collection`` instances in your application code with ``ExplainCollection`` instances.
123
+
Since ``ExplainableCollection`` instances provide all the same methods provided by ``Collection`` instances, explaining operations in your application code is a simple matter of replacing ``Collection`` instances in your application code with ``ExplainableCollection`` instances.
122
124
123
125
124
126
Explaining commands in a script
@@ -134,14 +136,23 @@ within the specified script, **in addition to running every command** in the scr
134
136
explain output is generated using the `logging <https://docs.python.org/3/library/logging.html>`_ module,
135
137
if your script configures logging module there are certain things to keep in mind:
136
138
137
-
- if your script sets the `logging level <https://docs.python.org/3/library/logging.html#logging-levels>`_
138
-
higher than INFO, the explain output will be suppressed entirely.
139
+
- if your script sets the `logging level <https://docs.python.org/3/library/logging.html#logging-levels>`_ higher than INFO, the explain output will be suppressed entirely.
139
140
- the explain output will be sent to whatever stream your script configures the logging module to send output to.
140
141
141
-
142
142
Any positional parameters or arguments required by your script can be
0 commit comments