-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
getCmdLineOpts.txt
88 lines (68 loc) · 1.94 KB
/
getCmdLineOpts.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
==============
getCmdLineOpts
==============
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. dbcommand:: getCmdLineOpts
The :dbcommand:`getCmdLineOpts` command returns a document
containing command line options used to start the given
:binary:`~bin.mongod` or :binary:`~bin.mongos`. Run
:dbcommand:`getCmdLineOpts` in the ``admin`` database.
Compatibility
-------------
This command is available in deployments hosted in the following environments:
.. include:: /includes/fact-environments-atlas-only.rst
.. include:: /includes/fact-environments-atlas-support-all.rst
.. include:: /includes/fact-environments-onprem-only.rst
Syntax
------
The command has the following syntax:
.. code-block:: javascript
db.adminCommand(
{
getCmdLineOpts: 1
}
)
Output
------
This command returns a document with two fields, ``argv`` and
``parsed``. The ``argv`` field contains an array with each item from
the command string used to invoke :binary:`~bin.mongod` or
:binary:`~bin.mongos`. The document in the ``parsed`` field includes all
runtime options, including those parsed from the command line and
those specified in the configuration file, if specified.
Consider the following example output of
:dbcommand:`getCmdLineOpts`:
.. code-block:: javascript
{
"argv" : [
"/usr/bin/mongod",
"--config",
"/etc/mongod.conf"
],
"parsed" : {
"config" : "/etc/mongod.conf",
"net" : {
"bindIp" : "127.0.0.1",
"port" : 27017
},
"processManagement" : {
"fork" : true
},
"storage" : {
"dbPath" : "/data/db"
},
"systemLog" : {
"destination" : "file",
"logAppend" : true,
"path" : "/var/log/mongodb/mongod.log"
}
},
"ok" : 1
}