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"
3
3
4
4
intersphinx = [" https://docs.mongodb.com/manual/objects.inv" ]
5
5
6
- toc_landing_pages = [" /crud" ]
6
+ toc_landing_pages = [" /run-commands " , " / crud" ]
7
7
8
8
[constants ]
9
9
Original file line number Diff line number Diff line change 1
- .. _mongosh-changelog
1
+ .. _mongosh-changelog:
2
2
3
3
=====================
4
4
``mongosh`` Changelog
@@ -58,11 +58,12 @@ the `MongoDB Download Center
58
58
Behavior Updates
59
59
~~~~~~~~~~~~~~~~
60
60
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.
66
67
67
68
Bug Fixes
68
69
~~~~~~~~~
@@ -87,7 +88,7 @@ Bug Fixes
87
88
.. note::
88
89
89
90
``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.
91
92
92
93
v0.2.2
93
94
------
Original file line number Diff line number Diff line change @@ -119,8 +119,7 @@ Learn More
119
119
120
120
/install
121
121
/connect
122
- /crud
123
- /run-agg-pipelines
122
+ /run-commands
124
123
/write-scripts
125
124
/logs
126
125
/reference
Original file line number Diff line number Diff line change @@ -56,7 +56,9 @@ Show List of Databases
56
56
57
57
show dbs
58
58
59
- ``show databases`` is an alias for ``show dbs``.
59
+ .. note::
60
+
61
+ ``show databases`` is an alias for ``show dbs``.
60
62
61
63
Show List of Database Methods
62
64
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