OPTIONS

getParameter

On this page

getParameter

getParameter is an administrative command for retrieving the value of options normally set on the command line. Use the db.runCommand( { command } ) method to run the getParameter command.

The getParameter command has the following syntax:

{
   getParameter: <value>,
   <parameter> : <value>
}

The command takes the following fields:

Field Type Description
getParameters int, *

* returns all parameters available to getParameters, ignoring the <parameter> field.

The value for <value> does not effect output otherwise.

<parameter> string

String name of the parameter to retrieve.

The value for <value> does not affect output.

Behavior

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.

Examples

Retrieve Single Parameter

The following operation runs getParameter on the admin database using a value of saslHostName to retrieve the value for that parameter:

use admin
db.runCommand( { getParameter : 1, "saslHostName" : 1 } )

The command returns the following output:

Note

The output may vary depending on the version of MongoDB and the specific configuration of the running MongoDB instance.

{ "saslHostName" : "www.example.net:27018", "ok" : 1 }

Retrieve All Parameters

The following operation runs getParameter on the admin database using a value of * to retrieve all parameters:

use admin
db.runCommand( { getParameter : '*' } )

The command returns the following output:

Note

The output may vary depending on the version of MongoDB and the specific configuration of the running MongoDB instance.

{
   "authSchemaVersion" : 5,
   "authenticationMechanisms" : [
      "MONGODB-CR",
      "MONGODB-X509",
      "SCRAM-SHA-1"
   ],
   "clusterAuthMode" : "undefined",
   "connPoolMaxConnsPerHost" : 200,
   "connPoolMaxShardedConnsPerHost" : 200,
   "cursorTimeoutMillis" : 600000,
   "diagnosticDataCollectionDirectorySizeMB" : 100,
   "diagnosticDataCollectionEnabled" : true,
   "diagnosticDataCollectionFileSizeMB" : 10,
   "diagnosticDataCollectionPeriodMillis" : 1000,
   "diagnosticDataCollectionSamplesPerChunk" : 300,
   "diagnosticDataCollectionSamplesPerInterimUpdate" : 10,
   "disableJavaScriptJIT" : false,
   "enableCollectionLocking" : true,
   "enableLocalhostAuthBypass" : true,
   "enableReplSnapshotThread" : false,
   "enableTestCommands" : false,
   "failIndexKeyTooLong" : true,
   "internalGeoNearQuery2DMaxCoveringCells" : 16,
   "internalGeoPredicateQuery2DMaxCoveringCells" : 16,
   "internalQueryCacheEvictionRatio" : 10,
   "internalQueryCacheFeedbacksStored" : 20,
   "internalQueryCacheSize" : 5000,
   "internalQueryEnumerationMaxIntersectPerAnd" : 3,
   "internalQueryEnumerationMaxOrSolutions" : 10,
   "internalQueryExecMaxBlockingSortBytes" : 33554432,
   "internalQueryExecYieldIterations" : 128,
   "internalQueryExecYieldPeriodMS" : 10,
   "internalQueryForceIntersectionPlans" : false,
   "internalQueryMaxScansToExplode" : 200,
   "internalQueryPlanEvaluationCollFraction" : 0.3,
   "internalQueryPlanEvaluationMaxResults" : 101,
   "internalQueryPlanEvaluationWorks" : 10000,
   "internalQueryPlanOrChildrenIndependently" : true,
   "internalQueryPlannerEnableHashIntersection" : false,
   "internalQueryPlannerEnableIndexIntersection" : true,
   "internalQueryPlannerMaxIndexedSolutions" : 64,
   "internalQueryS2GeoCoarsestLevel" : 0,
   "internalQueryS2GeoFinestLevel" : 23,
   "internalQueryS2GeoMaxCells" : 20,
   "internalSCCAllowFastestAuthConfigReads" : false,
   "internalSCCAllowFastestMetadataConfigReads" : false,
   "journalCommitInterval" : 0,
   "logComponentVerbosity" : {
      "verbosity" : 0,
      "accessControl" : {
         "verbosity" : -1
      },
      "command" : {
         "verbosity" : -1
      },
      "control" : {
         "verbosity" : -1
      },
      "executor" : {
         "verbosity" : -1
      },
      "geo" : {
         "verbosity" : -1
      },
      "index" : {
         "verbosity" : -1
      },
      "network" : {
         "verbosity" : -1,
         "asio" : {
            "verbosity" : -1
         },
         "bridge" : {
            "verbosity" : -1
         }
      },
      "query" : {
         "verbosity" : -1
      },
      "replication" : {
         "verbosity" : -1
      },
      "sharding" : {
         "verbosity" : -1
      },
      "storage" : {
         "verbosity" : -1,
         "journal" : {
            "verbosity" : -1
         }
      },
      "write" : {
         "verbosity" : -1
      },
      "ftdc" : {
         "verbosity" : -1
      }
   },
   "logLevel" : 0,
   "logUserIds" : false,
   "maxSyncSourceLagSecs" : 30,
   "newCollectionsUsePowerOf2Sizes" : true,
   "notablescan" : false,
   "queueForMigrationCommit" : true,
   "quiet" : false,
   "recoverShardingState" : true,
   "replApplyBatchSize" : 1,
   "replElectionTimeoutOffsetLimitFraction" : 0.15,
   "replIndexPrefetch" : "uninitialized",
   "replMonitorMaxFailedChecks" : 30,
   "replSnapshotThreadThrottleMicros" : 1000,
   "replWriterThreadCount" : 16,
   "saslHostName" : "www.example.net:27017",
   "saslServiceName" : "mongodb",
   "saslauthdPath" : "",
   "scramIterationCount" : 10000,
   "skipCorruptDocumentsWhenCloning" : false,
   "sslMode" : "disabled",
   "syncdelay" : 60,
   "taskExecutorPoolSize" : 0,
   "testingSnapshotBehaviorInIsolation" : false,
   "textSearchEnabled" : true,
   "traceExceptions" : false,
   "traceWriteConflictExceptions" : false,
   "ttlMonitorEnabled" : true,
   "ttlMonitorSleepSecs" : 60,
   "wiredTigerConcurrentReadTransactions" : 128,
   "wiredTigerConcurrentWriteTransactions" : 128,
   "wiredTigerEngineRuntimeConfig" : "",
   "ok" : 1
}

See also

setParameter for more about these parameters.