On this page本页内容
getParameter¶getParameter is an administrative command for retrieving the values of parameters. Use the db.adminCommand(
{ command } ) method to run the getParameter command in the admin database.
The getParameter command has the following syntax:语法如下所示:
The command takes the following fields:
getParameter |
int, '*' |
Specify a value of:
|
<parameter> |
string | String name of the parameter to retrieve. The value for |
comment |
any |
A comment can be any valid BSON type (string, integer, object, array, etc).
|
getParameter runs on the admin database only, and returns an error if run on any other database.
The possible value for <parameter> may vary depending on what version and storage engine in use. See Retrieve All Parameters for an example of listing the available parameters.
The following operation runs getParameter on the admin database using a value of saslHostName to retrieve the value for that parameter:
The command returns the following output:
Note
The output may vary depending on the version and specific configuration of your MongoDB instance.
The following operation runs getParameter with a value of '*' to retrieve all parameters:
Note
The output may vary depending on the version of MongoDB and the specific configuration of the running MongoDB instance.
See also参阅
setParameter for more about these parameters.