File tree Expand file tree Collapse file tree 5 files changed +67
-11
lines changed Expand file tree Collapse file tree 5 files changed +67
-11
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ title = "MongoDB Shell"
33
44intersphinx = [" https://docs.mongodb.com/manual/objects.inv" ]
55
6- toc_landing_pages = [" /crud" ]
6+ toc_landing_pages = [" /run-commands " , " / crud" ]
77
88[constants ]
99
Original file line number Diff line number Diff line change 1- .. _mongosh-changelog
1+ .. _mongosh-changelog:
22
33=====================
44``mongosh`` Changelog
@@ -58,11 +58,12 @@ the `MongoDB Download Center
5858Behavior Updates
5959~~~~~~~~~~~~~~~~
6060
61- The legacy ``mongo`` shell error handling was not consistent between
62- commands. ``mongosh`` now standardizes the user-facing behavior.
63- Whenever a shell helper issues a command that results in ``{ ok: 0 }``
64- ``mongosh`` throws an exception and does not return the raw output from
65- the server.
61+ Whenever a command's output includes ``{ ok: 0 }``, ``mongosh`` throws
62+ an exception and does not return the raw output from the server.
63+
64+ The legacy ``mongo`` shell error handling is not consistent between
65+ commands. ``mongosh`` standardizes the user-facing behavior for a
66+ more consistent experience.
6667
6768Bug Fixes
6869~~~~~~~~~
@@ -87,7 +88,7 @@ Bug Fixes
8788 .. note::
8889
8990 ``Ctrl+C`` terminates the process in the shell, but does not
90- terminate the process on the mongodb server.
91+ terminate the process on the MongoDB server.
9192
9293v0.2.2
9394------
Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ Learn More
119119
120120 /install
121121 /connect
122- /crud
123- /run-agg-pipelines
122+ /run-commands
124123 /write-scripts
125124 /logs
126125 /reference
Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ Show List of Databases
5656
5757 show dbs
5858
59- ``show databases`` is an alias for ``show dbs``.
59+ .. note::
60+
61+ ``show databases`` is an alias for ``show dbs``.
6062
6163Show List of Database Methods
6264 To see the list of methods you can use on the ``db``
Original file line number Diff line number Diff line change 1+ .. _run-commands:
2+
3+ ===========================
4+ Run Commands in ``mongosh``
5+ ===========================
6+
7+ .. default-domain:: mongodb
8+
9+ .. contents:: On this page
10+ :local:
11+ :backlinks: none
12+ :depth: 1
13+ :class: singlecol
14+
15+ .. include:: /includes/admonitions/fact-mdb-shell-beta.rst
16+
17+ For documentation of basic MongoDB operations in ``mongosh``, see:
18+
19+ - :doc:`/crud`
20+
21+ - :doc:`/run-agg-pipelines`
22+
23+ - :doc:`/reference/methods`
24+
25+ Terminate a Running Command
26+ ---------------------------
27+
28+ To terminate a running command or query in ``mongosh``,
29+ press ``Ctrl + C``.
30+
31+ ``Ctrl + C`` terminates the process in the shell, but does not
32+ terminate the process on the MongoDB server. This behavior
33+ differs from the :method:`db.killOp()` method, which terminates
34+ commands on the server.
35+
36+ Command Exceptions
37+ ------------------
38+
39+ In scenarios where the output of a command includes ``{ ok: 0 }``,
40+ ``mongosh`` throws an exception and does not return the raw output from
41+ the server.
42+
43+ .. note::
44+
45+ In the legacy ``mongo`` shell, when a command's output included ``{
46+ ok: 0 }``, the behavior differs between commands. ``mongosh``
47+ provides consistent behavior by always throwing an exception in these
48+ scenarios.
49+
50+ .. toctree::
51+ :titlesonly:
52+
53+ /crud
54+ /run-agg-pipelines
You can’t perform that action at this time.
0 commit comments