Skip to content

Commit e6b9c26

Browse files
(DOCSP-23224): TOC refactor (#216)
* (DOCSP-23224): TOC refactor * fix page title * remove toc on usage page * change title * add configuration landing page * tweaks * improvements to write scripts page * wording * more adjustments * fix formatting * more tweaks * adjust heading * adjustments * fix line number example copy * remove extra blank lines * add toc to script limitations page * clarification * formatting * fix mongorc.js formatting * add heading * formatting * fix page titles and alphabetize * address feedback * remove gerunds * remove editor mode from landing page
1 parent 2de2c9b commit e6b9c26

25 files changed

+442
-489
lines changed

snooty.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ toc_landing_pages = ["/run-commands",
88
"/field-level-encryption",
99
"/write-scripts",
1010
"/snippets",
11+
"/configure-mongosh",
1112
"/reference/configure-shell-settings"
1213
]
1314

source/changelog.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _mongosh-changelog:
22

3-
=====================
4-
``mongosh`` Changelog
5-
=====================
3+
=============
4+
Release Notes
5+
=============
66

77
.. default-domain:: mongodb
88

source/configure-mongosh.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
.. _mongosh-configure:
2+
3+
=====================
4+
Configure ``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+
Learn how to configure ``mongosh`` behaviors and user experience:
16+
17+
- :ref:`mongosh-editor-mode`
18+
- :ref:`mongosh-shell-settings`
19+
- :ref:`customize-the-mongosh-prompt`
20+
- :ref:`telemetry`
21+
- :ref:`free-monitoring-mongosh`
22+
23+
.. toctree::
24+
:titlesonly:
25+
26+
/reference/editor-mode
27+
/reference/configure-shell-settings
28+
/reference/customize-prompt
29+
/telemetry
30+
/free-monitoring

source/free-monitoring.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _free-monitoring-mongosh:
22

3-
===============
4-
Free Monitoring
5-
===============
3+
=========================
4+
Configure Free Monitoring
5+
=========================
66

77
.. default-domain:: mongodb
88

source/includes/examples/ex-display-line-numbers.rst

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
This code will dynamically update the :binary:`~bin.mongosh` prompt
2-
to display line numbers:
1+
To display line numbers in the :binary:`~bin.mongosh` prompt, run the
2+
following code inside ``mongosh``:
33

44
.. code-block:: javascript
55
@@ -15,4 +15,3 @@ The prompt will look like this:
1515
1> show collections
1616
2> use test
1717
3>
18-
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,20 @@
1-
On startup, :binary:`mongosh` checks the user's ``HOME`` directory for
2-
a JavaScript file named :ref:`.mongoshrc.js <mongoshrc-js>`. If this
3-
file is found, :binary:`mongosh` reads the content of
4-
:ref:`.mongoshrc.js <mongoshrc-js>` before displaying the prompt for
5-
the first time.
1+
On startup, :binary:`mongosh` checks your ``HOME`` directory for a
2+
JavaScript file named .mongoshrc.js. If this file is found,
3+
:binary:`mongosh` reads the content of .mongoshrc.js before
4+
displaying the prompt for the first time.
65

76
If you use :binary:`mongosh` to evaluate a JavaScript file or
8-
expression, either by using the :option:`--eval <mongosh --eval>`
9-
option on the command line or by specifying a :ref:`.js file
10-
<mdb-shell-execute-file>`, :binary:`mongosh` reads :ref:`.mongoshrc.js
11-
<mongoshrc-js>` *after* the JavaScript has finished processing. You can
12-
prevent :ref:`.mongoshrc.js <mongoshrc-js>` from being loaded by using
13-
the :option:`--norc <mongosh --norc>` option.
7+
expression, either by using the :option:`--eval <mongosh --eval>` option
8+
on the command line or by specifying a :ref:`.js file
9+
<mdb-shell-execute-file>`, :binary:`mongosh` reads .mongoshrc.js
10+
*after* the JavaScript has finished processing. You can prevent
11+
.mongoshrc.js from being loaded by using the :option:`--norc
12+
<mongosh --norc>` option.
1413

1514
.. note::
1615

17-
The legacy :binary:`~bin.mongo` shell used a configuation file
18-
called ``.mongorc.js``. If :binary:`mongosh` detects this file on
19-
startup, and :ref:`.mongoshrc.js <mongoshrc-js>` is not present,
20-
:binary:`mongosh` will suggest renaming ``.mongorc.js`` to
21-
:ref:`.mongoshrc.js <mongoshrc-js>`.
22-
23-
The legacy ``.mongorc.js`` file is not loaded.
24-
16+
The legacy :binary:`~bin.mongo` shell used a configuration file
17+
called .mongorc.js. If :binary:`mongosh` detects this file on
18+
startup, and .mongoshrc.js is not present, :binary:`mongosh` does not
19+
load the legacy .mongorc.js file, and suggests renaming .mongorc.js
20+
to .mongoshrc.js.

source/index.txt

Lines changed: 7 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ MongoDB download center.
2727
Download and Install ``mongosh``
2828
--------------------------------
2929

30-
To learn how to download and install the :binary:`~bin.mongosh` binary,
31-
see :ref:`mdb-shell-install`.
30+
To learn how to download and install the ``mongosh`` binary, see
31+
:ref:`mdb-shell-install`.
3232

3333
Connect to a MongoDB Deployment
3434
-------------------------------
@@ -37,20 +37,6 @@ Once you have installed the |mdb-shell| and added it to your system
3737
``PATH``, you can connect to a MongoDB deployment. To learn more, see
3838
:ref:`mdb-shell-connect`.
3939

40-
.. _mdb-shell-multi-line:
41-
42-
``mongosh`` Editor Mode
43-
-----------------------
44-
45-
The :binary:`~bin.mongosh` console is line oriented. However, you can
46-
also use an editor to work with multiline functions. There are two
47-
options:
48-
49-
- An external editor, accessed with the ``edit`` command
50-
- A built-in editor, accessed with the ``.editor`` command
51-
52-
For further details see :ref:`mongosh-editor-mode`.
53-
5440
The |mdb-shell| versus the Legacy ``mongo`` Shell
5541
-------------------------------------------------
5642

@@ -95,14 +81,12 @@ Learn More
9581

9682
/install
9783
/connect
98-
/free-monitoring
99-
/field-level-encryption
100-
/logs
84+
/configure-mongosh
10185
/run-commands
102-
/snippets
86+
/crud
87+
/run-agg-pipelines
88+
/field-level-encryption
10389
/write-scripts
90+
/snippets
10491
/reference
10592
/reference/access-mdb-shell-help.txt
106-
/reference/compatibility
107-
/changelog
108-

source/mongoshrc.txt

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -18,35 +18,9 @@
1818

1919
.. include:: /includes/fact-mongoshrc-loading.rst
2020

21-
Examples
22-
--------
23-
24-
The following examples create custom prompts. To display:
25-
26-
- :ref:`line numbers <ex-display-line-numbers>`
27-
- :ref:`database and hostname <ex-display-dbname-and-hostname>`
28-
- :ref:`system uptime and document count <ex-display-system-up-time>`
29-
30-
add the example code to :ref:`.mongoshrc.js <mongoshrc-js>`.
31-
32-
.. _ex-display-line-numbers:
33-
34-
Display Line Numbers
35-
~~~~~~~~~~~~~~~~~~~~
36-
37-
.. include:: /includes/examples/ex-display-line-numbers.rst
38-
39-
.. _ex-display-dbname-and-hostname:
40-
41-
Display Database and Hostname
42-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
43-
44-
.. include:: /includes/examples/ex-display-dbname-and-hostname.rst
45-
46-
.. _ex-display-system-up-time:
47-
48-
Display System Up Time and Document Count
49-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
50-
51-
.. include:: /includes/examples/ex-display-system-uptime.rst
21+
Example Usage
22+
-------------
5223

24+
You can use the .mongoshrc file to customize ``mongosh`` startup
25+
behavior and add scripted functionality. For examples, see
26+
:ref:`mongosh-write-scripts-config-file`.

source/reference.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ Reference
99
.. toctree::
1010
:titlesonly:
1111

12-
/reference/configure-shell-settings
13-
/reference/editor-mode
12+
/reference/compatibility
1413
/reference/data-types
1514
/reference/methods
15+
/mongoshrc
1616
/reference/options
17-
17+
/changelog
18+
/logs

source/reference/access-mdb-shell-help.txt

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _mdb-shell-help:
22
.. _mongosh-help:
33

4-
==========================
5-
Access Help in ``mongosh``
6-
==========================
4+
================
5+
``mongosh`` Help
6+
================
77

88
.. default-domain:: mongodb
99

@@ -436,5 +436,3 @@ certain database commands and obtain information on your deployment:
436436

437437
* - ``show users``
438438
- Display a list of users for current database.
439-
440-

source/reference/configure-shell-settings-api.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _configure-settings-api:
22

3-
==============================================
4-
Configure :binary:`~bin.mongosh` Using the API
5-
==============================================
3+
================================
4+
Configure Settings Using the API
5+
================================
66

77
.. default-domain:: mongodb
88

source/reference/configure-shell-settings-global.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _configure-settings-global:
22

3-
===========================================================
4-
Configure :binary:`~bin.mongosh` Using a Configuration File
5-
===========================================================
3+
=============================================
4+
Configure Settings Using a Configuration File
5+
=============================================
66

77
.. default-domain:: mongodb
88

source/reference/configure-shell-settings.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _mongosh-shell-settings:
22

3-
================================
4-
Configure :binary:`~bin.mongosh`
5-
================================
3+
==================
4+
Configure Settings
5+
==================
66

77
.. default-domain:: mongodb
88

@@ -35,4 +35,3 @@ To configure ``mongosh`` settings, you can either use:
3535

3636
/reference/configure-shell-settings-api
3737
/reference/configure-shell-settings-global
38-
/reference/customize-prompt

source/reference/data-types.txt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
======================
2-
``mongosh`` Data Types
3-
======================
1+
==========
2+
Data Types
3+
==========
44

55
.. default-domain:: mongodb
66

@@ -636,4 +636,3 @@ the output of :method:`db.collection.find()` is a ``Cursor``.
636636

637637
var findResults = db.housing.find({"multiUnit": true} )
638638
findResults.constructor.name // Returns the type
639-

source/reference/editor-mode.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
.. _mongosh-editor-mode:
2+
.. _mdb-shell-multi-line:
23

3-
===========
4-
Editor Mode
5-
===========
4+
==========================
5+
Use an Editor for Commands
6+
==========================
67

78
.. default-domain:: mongodb
89

@@ -328,4 +329,3 @@ To leave the editor,
328329
Objects which are declared using ``.editor``, like ``albums`` in this
329330
example, are added to the global scope. They are available after
330331
``.editor`` closes.
331-

source/reference/methods.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
.. _mdb-shell-methods:
22

3-
===================
4-
``mongosh`` Methods
5-
===================
3+
=======
4+
Methods
5+
=======
66

77
.. default-domain:: mongodb
88

source/reference/options.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
===================
2-
``mongosh`` Options
3-
===================
1+
=======
2+
Options
3+
=======
44

55
.. default-domain:: mongodb
66

0 commit comments

Comments
 (0)