Skip to content

Commit d883adb

Browse files
authored
DOCS-15069 getParameter exposes settability for server params (#553)
* command to expose settability for server params * review feedback * updates description of "*" * addresses duplicate target name getParameter-showdetails-all-params
1 parent 2c7fc37 commit d883adb

File tree

2 files changed

+76
-7
lines changed

2 files changed

+76
-7
lines changed

source/reference/command/getParameter.txt

Lines changed: 62 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,31 @@ getParameter
4242

4343
* - ``getParameter``
4444

45-
- int, ``'*'``
45+
- int, string, document
4646

4747
- Specify a value of:
4848

49-
- ``'*'`` to return all parameters available to
50-
:dbcommand:`getParameter`, ignoring the ``<parameter>`` field.
51-
52-
- any numerical value to return the value for the specified
53-
``<parameter>``.
49+
- ``1`` (or any integer value) to return the value for the
50+
specified ``<parameter>``.
5451

52+
- ``'*'`` to return values for all parameters available to
53+
:dbcommand:`getParameter`, ignoring the ``<parameter>`` field.
54+
55+
- ``{ showDetails: true }`` to return a document containing:
56+
57+
.. _showdetails-fields:
58+
59+
- ``value``, the value that ``<parameter>`` is set to
60+
- ``settableAtRuntime``, whether or not ``<parameter>`` can
61+
be set at runtime
62+
- ``settableAtStartup``, whether or not ``<parameter>`` can
63+
be set at startup
5564

65+
- ``{ showDetails: true, allParameters: true }`` to return a
66+
document containing :ref:`showDetails fields
67+
<showdetails-fields>` for **all** parameters.
68+
69+
5670

5771
* - ``<parameter>``
5872

@@ -126,4 +140,45 @@ The following operation runs :dbcommand:`getParameter` with a value of
126140
:dbcommand:`setParameter` for more about these parameters.
127141

128142

129-
.. slave-ok, admin-only
143+
.. _getParameter-showdetails-single-param:
144+
145+
Report Details on a Single Parameter
146+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
147+
148+
The following example runs :dbcommand:`getParameter` with
149+
``{showDetails: true}`` to report :ref:`details <showdetails-fields>`
150+
on :parameter:`saslHostName`.
151+
152+
.. code-block:: javascript
153+
154+
db.adminCommand( { getParameter : { showDetails: true }, "saslHostName" : 1 } )
155+
156+
Example output:
157+
158+
.. code-block:: javascript
159+
:copyable: false
160+
161+
{
162+
saslHostName: {
163+
value: '<hostname>',
164+
settableAtRuntime: false,
165+
settableAtStartup: true
166+
},
167+
ok: 1
168+
}
169+
170+
.. include:: /includes/note-output-may-vary.rst
171+
172+
173+
.. _getParameter-showdetails-all-params:
174+
175+
Report Details for All Parameters
176+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
177+
178+
The following example runs :dbcommand:`getParameter` with
179+
``{showDetails: true, allParameters: true}`` to report
180+
:ref:`details <showdetails-fields>` on **all** parameters.
181+
182+
.. code-block:: javascript
183+
184+
db.adminCommand( { getParameter : { showDetails: true, allParameters: true } } )

source/release-notes/5.3.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,20 @@ Starting in MongoDB 5.3, :dbcommand:`serverStatus` includes
3737
:serverstatus:`connections.loadBalanced` which reports the
3838
number of incoming connections received through a load balancer.
3939

40+
``getParameter`` can Report When Parameters can be Set
41+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
42+
43+
Starting in MongoDB 5.3, ``getParameter`` can report:
44+
45+
- whether a parameter can be set at startup
46+
- whether a parameter can be set during runtime
47+
48+
You can use the ``getParameter`` command to report :ref:`parameter
49+
details <showdetails-fields>` by passing ``{ showDetails: true }``. You
50+
can use ``getParameter`` to report :ref:`details on all parameters
51+
<getParameter-showdetails-all-params>` by passing
52+
``{ showDetails: true, allParameters: true }``.
53+
4054
Security
4155
--------
4256

0 commit comments

Comments
 (0)