diff --git a/source/includes/note-enabletestcommands.rst b/source/includes/note-enabletestcommands.rst new file mode 100644 index 00000000000..6a3b50f931b --- /dev/null +++ b/source/includes/note-enabletestcommands.rst @@ -0,0 +1,7 @@ +.. note:: + + |dbcommand| is an internal command that is not enabled by default. + |dbcommand| must be enabled by using + :option:`--setParameter enableTestCommands=1 ` + on the :program:`mongod` command line. + |dbcommand| cannot be enabled during run-time. diff --git a/source/reference/command/captrunc.txt b/source/reference/command/captrunc.txt new file mode 100644 index 00000000000..1a3858d4c7f --- /dev/null +++ b/source/reference/command/captrunc.txt @@ -0,0 +1,35 @@ +=================== +captrunc (internal) +=================== + +.. default-domain:: mongodb + +.. dbcommand:: captrunc + + The :dbcommand:`captrunc` command is an internal command that is used + to truncate capped collections. + + :param string collection: the name of the collection to truncate. + :param integer n: a BSON document specifying the number of documents to + remove. + :param Boolean inc: specifies whether to truncate the ``n``th document. + + .. example:: + + Truncate 10 ``older`` documents from the collection :samp:`example`: + + .. code-block:: javascript + + db.runCommand({captrunc: "example" , n:10}) + + Truncate 100 documents and the 101st document: + + .. code-block:: javascript + + db.runCommand({captrunc: "example", n:100, inc:true}) + + .. |dbcommand| replace:: :dbcommand:`replSetTest` + .. include:: /includes/note-enabletestcommands.rst + + .. write-lock + .. testcommand diff --git a/source/reference/command/configureFailPoint.txt b/source/reference/command/configureFailPoint.txt new file mode 100644 index 00000000000..671dc96da05 --- /dev/null +++ b/source/reference/command/configureFailPoint.txt @@ -0,0 +1,21 @@ +============================= +configureFailPoint (internal) +============================= + +.. default-domain:: mongodb + +.. dbcommand:: configureFailPoint + + :dbcommand:`configureFailPoint` is an internal testing command that + configures failure points. + + :param string: specifies the name of the failure point. + :param string mode: specifies whether failure point is always on + :samp:`alwaysOn` or :samp:`off`. + + :param mode: Specify a document ``{times: n}`` + to control the number of times the failure point + is activated. + + .. |dbcommand| replace:: :dbcommand:`configureFailPoint` + .. include:: /includes/note-enabletestcommands.rst diff --git a/source/reference/command/emptycapped.txt b/source/reference/command/emptycapped.txt index 6b6f469365a..8e90caefc48 100644 --- a/source/reference/command/emptycapped.txt +++ b/source/reference/command/emptycapped.txt @@ -1,6 +1,6 @@ -=========== -emptycapped -=========== +====================== +emptycapped (internal) +====================== .. default-domain:: mongodb @@ -20,3 +20,6 @@ emptycapped This command obtains a write lock on the affected database and will block other operations until it has completed. + + .. |dbcommand| replace:: :dbcommand:`emptycapped` + .. include:: /includes/note-enabletestcommands.rst diff --git a/source/reference/command/godinsert.txt b/source/reference/command/godinsert.txt index 9685ecf1899..b94a6421af8 100644 --- a/source/reference/command/godinsert.txt +++ b/source/reference/command/godinsert.txt @@ -13,4 +13,8 @@ godinsert (internal) This command obtains a write lock on the affected database and will block other operations until it has completed. + .. |dbcommand| replace:: :dbcommand:`godinsert` + .. include:: /includes/note-enabletestcommands.rst + + .. write-lock, slave-ok diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt new file mode 100644 index 00000000000..b45b68102c7 --- /dev/null +++ b/source/reference/command/hashBSONElement.txt @@ -0,0 +1,71 @@ +=========================== +_hashBSONElement (internal) +=========================== + +.. default-domain:: mongodb + +.. dbcommand:: _hashBSONElement + + .. versionaddded:: 2.3.2 + + :dbcommand:`_hashBSONElement` + is an internal command that computes the MD5 hash of a BSON element. + Eight (8) bytes are returned from the 16 byte MD5 hash. + + :param BSONElement key: specifies the BSON element to hash. + + :param integer seed: specifies a seed to use to compute the hash. + + :returns: A document consisting of ``key``, ``seed``, ``out`` + and ``ok`` fields. + + :field BSONType key: the original BSON element. + :field integer seed: the seed used for the hash, defaults to 0. + :field NumberLong out: the decimal result of the hash. + :field integer ok: exit code (1 = ok, 0 = error) + + + .. |dbcommand| replace:: :dbcommand:`_hashBSONElement` + .. include:: /includes/note-enabletestcommands.rst + + .. example:: + + .. code-block:: sh + + mongod --setParameter=enableTestCommands=1 + + .. example:: + + Hash an ISODate string: + + .. code-block:: javascript + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z")}) + + Which returns the following document: + + .. code-block:: javascript + + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 0, + "out" : NumberLong("-4185544074338741873"), + "ok" : 1 + } + + Hash the same ISODate string but specify a seed value: + + .. code-block:: javascript + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z"), seed:2013}) + + Which returns the following document: + + .. code-block:: javascript + + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 2013, + "out" : NumberLong("7845924651247493302"), + "ok" : 1 + } \ No newline at end of file diff --git a/source/reference/command/journalLatencyTest.txt b/source/reference/command/journalLatencyTest.txt index 097a9183c12..113a64617a1 100644 --- a/source/reference/command/journalLatencyTest.txt +++ b/source/reference/command/journalLatencyTest.txt @@ -19,3 +19,6 @@ journalLatencyTest The value (i.e. ``1`` above), does not affect the operation of the command. + + .. |dbcommand| replace:: :dbcommand:`_journalLatencyTest` + .. include:: /includes/note-enabletestcommands.rst diff --git a/source/reference/command/replSetTest.txt b/source/reference/command/replSetTest.txt index d2fa4d8fa16..d53a2d72fbd 100644 --- a/source/reference/command/replSetTest.txt +++ b/source/reference/command/replSetTest.txt @@ -9,4 +9,9 @@ replSetTest (internal) :dbcommand:`replSetTest` is internal diagnostic command used for regression tests that supports replica set functionality. + .. |dbcommand| replace:: :dbcommand:`replSetTest` + .. include:: /includes/note-enabletestcommands.rst + + .. slave-ok, admin-only + diff --git a/source/reference/command/setParameter.txt b/source/reference/command/setParameter.txt index 7fa9eed4ed7..994de5da7a1 100644 --- a/source/reference/command/setParameter.txt +++ b/source/reference/command/setParameter.txt @@ -138,6 +138,54 @@ setParameter .. seealso:: :setting:`syncdelay`. - - + + :option boolean enableLocalhostAuthBypass: + + .. versionadded: 2.4 + + Specify :samp:`0` to disable localhost authentication bypass. + Enabled by default. + + :option boolean logUserIds: + + .. versionadded: 2.4 + + Specify :samp:`1` to enable logging of userids. + Disabled by default. + + :option integer replApplyBatchSize: + + .. versionadded: 2.4 + + Specify the number of oplog entries to apply as a single batch. + :option:`replApplyBatchSize` must be an integer from 1 to 1024. + This option may only be specified on a slave machine. + The batch size cannot be greater than ``1`` if setting:`slaveDelay` + is also set. + + :option replIndexPrefetch: + + :option supportCompatibilityFormPrivilegeDocuments: + + :option boolean enableTestCommands: + + .. versionadded: 2.4 + + This option **cannot** be specified using the :dbcommand:`setParameter` + command. This option can only be specified on the :program:`mongod` + command invocation. + This option enables the following internal commands: + + - :dbcommand:`captrunc` + - :dbcommand:`configureFailPoint` + - :dbcommand:`emptycapped` + - :dbcommand:`godinsert` + - :dbcommand:`_hashBSONElement` + - :dbcommand:`journalLatencyTest` + - :dbcommand:`replSetTest` + - :dbcommand:`_skewClockCommand` + - :dbcommand:`sleep` + - :dbcommand:`_testDistLockWithSkew` + - :dbcommand:`_testDistLockWithSyncCluster` + .. slave-ok, admin-only diff --git a/source/reference/command/skewClockCommand.txt b/source/reference/command/skewClockCommand.txt index 4f2eafce107..0b6383d3546 100644 --- a/source/reference/command/skewClockCommand.txt +++ b/source/reference/command/skewClockCommand.txt @@ -9,4 +9,7 @@ skewClockCommand (internal) :dbcommand:`_skewClockCommand` is an internal command. Do not call directly. + .. |dbcommand| replace:: :dbcommand:`_skewClockCommand` + .. include:: /includes/note-enabletestcommands.rst + .. admin-only diff --git a/source/reference/command/sleep.txt b/source/reference/command/sleep.txt index 42662da7a67..08c0f592484 100644 --- a/source/reference/command/sleep.txt +++ b/source/reference/command/sleep.txt @@ -30,3 +30,6 @@ sleep (internal) instance for the specified amount of time. .. read-lock, write-lock, global-lock + + .. |dbcommand| replace:: :dbcommand:`sleep` + .. include:: /includes/note-enabletestcommands.rst diff --git a/source/reference/command/testDistLockWithSkew.txt b/source/reference/command/testDistLockWithSkew.txt index fee393f0930..7c4ad7eda6d 100644 --- a/source/reference/command/testDistLockWithSkew.txt +++ b/source/reference/command/testDistLockWithSkew.txt @@ -10,3 +10,6 @@ testDistLockWithSkew (internal) directly. .. admin-only + + .. |dbcommand| replace:: :dbcommand:`_testDistLockWithSkew` + .. include:: /includes/note-enabletestcommands.rst diff --git a/source/reference/command/testDistLockWithSyncCluster.txt b/source/reference/command/testDistLockWithSyncCluster.txt index 8ce8b84c37b..e8c851ad232 100644 --- a/source/reference/command/testDistLockWithSyncCluster.txt +++ b/source/reference/command/testDistLockWithSyncCluster.txt @@ -10,3 +10,6 @@ testDistLockWithSyncCluster (internal) directly. .. admin-only + + .. |dbcommand| replace:: :dbcommand:`_testDistLockWithSyncCluster` + .. include:: /includes/note-enabletestcommands.rst \ No newline at end of file diff --git a/source/reference/mongod.txt b/source/reference/mongod.txt index f213c4cf0fa..e4f3b12b636 100644 --- a/source/reference/mongod.txt +++ b/source/reference/mongod.txt @@ -390,6 +390,66 @@ Options for the :option:`--repair` operation. Defaults to a ``_tmp`` directory within the :setting:`dbpath`. +.. option:: --setParameter + + Specifies an option to configure on startup. Specify multiple options + with multiple :option:`--setParameter` options. + See :dbcommand:`setParameter` for a list of options which may be set + with :option:`--setParameter`. + +.. option:: --setParameter enableTestCommands=1 + + .. versionadded:: 2.4 + + Use :option:`--setParameter enableTestCommands=1` to enable a series + of internal commands. This option can only be enabled on + invocation of :program:`mongod` and cannot be enabled with the + :dbcommand:`setParameter` command. + + This option enables the following internal commands: + + - :dbcommand:`captrunc` + - :dbcommand:`configureFailPoint` + - :dbcommand:`emptycapped` + - :dbcommand:`godinsert` + - :dbcommand:`_hashBSONElement` + - :dbcommand:`journalLatencyTest` + - :dbcommand:`replSetTest` + - :dbcommand:`_skewClockCommand` + - :dbcommand:`sleep` + - :dbcommand:`_testDistLockWithSkew` + - :dbcommand:`_testDistLockWithSyncCluster` + +.. option:: --setParameter + + Specifies an option to configure on startup. Specify multiple options + with multiple :option:`--setParameter` options. + See :dbcommand:`setParameter` for a list of options which may be set + with :option:`--setParameter`. + +.. option:: --setParameter enableTestCommands=1 + + .. versionadded:: 2.4 + + Use :option:`--setParameter enableTestCommands=1` to enable a series + of internal commands. This option can only be enabled on + invocation of :program:`mongod` and cannot be enabled with the + :dbcommand:`setParameter` command. + + This option enables the following internal commands: + + - :dbcommand:`captrunc` + - :dbcommand:`configureFailPoint` + - :dbcommand:`emptycapped` + - :dbcommand:`godinsert` + - :dbcommand:`_hashBSONElement` + - :dbcommand:`journalLatencyTest` + - :dbcommand:`replSetTest` + - :dbcommand:`_skewClockCommand` + - :dbcommand:`sleep` + - :dbcommand:`_testDistLockWithSkew` + - :dbcommand:`_testDistLockWithSyncCluster` + .. option:: --slowms Defines the value of "slow," for the :option:`--profile`