Skip to content

Commit bc1664c

Browse files
(DOCS-13197): Explain result improvements for mongos
1 parent 46edf4b commit bc1664c

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

source/reference/explain-results.txt

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,8 @@ the ``explain`` operation.
637637
content: |
638638

639639
For sharded collections, ``explain`` returns the
640-
``serverInfo`` for each accessed shard.
640+
``serverInfo`` for each accessed shard, and a top-level
641+
``serverInfo`` object for the :binary:`~bin.mongos`.
641642

642643
.. code-block:: none
643644

@@ -659,6 +660,14 @@ the ``explain`` operation.
659660
}
660661
...
661662
]
663+
}
664+
},
665+
"serverInfo" : { // serverInfo for mongos
666+
"host" : <string>,
667+
"port" : <int>,
668+
"version" : <string>,
669+
"gitVersion" : <string>
670+
}
662671

663672
3.0 Format Change
664673
-----------------

source/release-notes/4.2.txt

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,24 @@ Starting in MongoDB 4.2, the ``explain`` output can include a new
17941794
:data:`~explain.queryPlanner.optimizedPipeline` field. For details,
17951795
refer to :data:`~explain.queryPlanner.optimizedPipeline`.
17961796

1797+
Starting in version 4.2 (and 4.0.14, 3.6.16):
1798+
1799+
- :doc:`Explain results </reference/explain-results/>` for commands run
1800+
on sharded clusters include a top-level :ref:`serverInfo <serverInfo>`
1801+
object for the :binary:`~bin.mongos` in addition to the ``serverInfo``
1802+
objects returned for each shard.
1803+
1804+
- :doc:`Explain results </reference/explain-results/>` include the
1805+
:ref:`serverInfo <serverInfo>` object when
1806+
:data:`~explain.queryPlanner.optimizedPipeline` is ``true``. In
1807+
previous versions of MongoDB, ``explain`` results would occasionally
1808+
not include the ``serverInfo`` object when
1809+
:data:`~explain.queryPlanner.optimizedPipeline` was ``true``.
1810+
1811+
.. seealso::
1812+
1813+
:doc:`Explain results </reference/explain-results/>`.
1814+
17971815
Change to ``isMaster`` Output
17981816
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17991817

0 commit comments

Comments
 (0)