Skip to content

Commit 344735f

Browse files
(DOCSP-20843): config reset (#189)
* (DOCSP-20843): config reset * fix broken link * tense * remove extra word * remove extra word * changelog wording * updates per copy review * standardize step phrasing
1 parent 10a0a08 commit 344735f

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

source/changelog.txt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ v1.2.1
2020
- :issue:`MONGOSH-1063` - You can now create a global ``monogosh``
2121
:ref:`configuration file <mongosh-shell-settings>`.
2222

23-
- :issue:`MONGOSH-959` – You can now use the ``config.reset`` method to
24-
return to the default configuration settings.
23+
- :issue:`MONGOSH-959` – You can now use the :ref:`config.reset
24+
<example-reset-setting>` method to reset a configuration setting to
25+
the default value.
2526

2627
- :issue:`MONGOSH-1133` – ``mongosh`` adds a :option:`--tlsUseSystemCA`
2728
option that causes ``mongosh`` to attempt to load system

source/reference/configure-shell-settings.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@ Change the current setting of ``<property>`` to ``<value>``:
4646

4747
config.set( "<property>", <value> )
4848

49+
Reset a ``<property>`` to the default value:
50+
51+
.. code-block:: javascript
52+
53+
config.reset( "<property>" )
54+
4955
Supported ``property`` parameters
5056
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5157

@@ -324,3 +330,34 @@ changes. (Note that this stores the most recent input first.)
324330
db.contacts.find( {"email": "<email>" } )
325331
config.set( "redactHistory", "remove-redact" )
326332

333+
.. _example-reset-setting:
334+
335+
Reset a Configuration Setting to the Default Value
336+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
337+
338+
If you modified a configuration setting and want to reset it to the
339+
default value, use ``config.reset( "<property>" )``.
340+
341+
#. Change the value of the ``historyLength`` setting to ``2000``:
342+
343+
.. code-block:: javascript
344+
345+
config.set("historyLength", 2000)
346+
347+
#. Verify the updated value for ``historyLength``:
348+
349+
.. code-block:: javascript
350+
351+
config.get("historyLength")
352+
353+
#. Reset the ``historyLength`` setting to the default value of ``1000``:
354+
355+
.. code-block:: javascript
356+
357+
config.reset("historyLength")
358+
359+
#. Verify the updated value for ``historyLength``:
360+
361+
.. code-block:: javascript
362+
363+
config.get("historyLength")

0 commit comments

Comments
 (0)