File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -260,6 +260,32 @@ when querying and their corresponding methods as examples.
260
260
# MongoDB 2.6
261
261
client[:artists].find.explain(verbose: true)
262
262
263
+ The explain operation supports ``:session`` and ``:read``
264
+ (for read preference) options. To specify these options for a single
265
+ explain operation, they must be given to the ``find`` method as
266
+ follows:
267
+
268
+ .. code-block:: ruby
269
+
270
+ client[:artists].find({}, session: session).explain
271
+
272
+ client[:artists].find({}, read: {mode: :secondary_preferred}).explain
273
+
274
+ If the read preference option is specified on the client or on the
275
+ collection, it will be passed to the explain operation:
276
+
277
+ .. code-block:: ruby
278
+
279
+ client[:artists, read: {mode: :secondary_preferred}].find.explain
280
+
281
+ Note that the session option is not accepted when creating a collection
282
+ object.
283
+
284
+ The explain command does not support passing the read concern option.
285
+ If the read concern is specifed on the client or collection level, or
286
+ if the read concern is specified as a find option, it will NOT be passed
287
+ by the driver to the explain command.
288
+
263
289
.. note::
264
290
265
291
The information returned by the server for the ``explain`` command
You can’t perform that action at this time.
0 commit comments