From 2f99a0a378b4ef701deb8535dc1a46cfa9c4669d Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 12 Feb 2013 17:44:47 -0500 Subject: [PATCH 1/8] DOCS-1069 document _hashBSONElement command --- source/reference/command/hashBSONElement.txt | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 source/reference/command/hashBSONElement.txt diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt new file mode 100644 index 00000000000..8ca7396d8e2 --- /dev/null +++ b/source/reference/command/hashBSONElement.txt @@ -0,0 +1,51 @@ +.. _hashBSONElement: + +=========================== +_hashBSONElement (internal) +=========================== + +.. default-domain:: mongodb + +.. dbcommand:: _hashBSONElement() + + :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. + + :dbcommand:`_hashBSONElement` is an internal command which must be + explicitly enabled on the :program:`mongod` command line using the + :option:`mongod --setParameter` option: + + .. example:: + + .. code-block:: sh + + mongod --setParameter=enableTestCommands=1 + + .. example:: + + .. code-block:: javascript + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z")}) + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 0, + "out" : NumberLong("-4185544074338741873"), + "ok" : 1 + } + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z"), seed:2013}) + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 2013, + "out" : NumberLong("7845924651247493302"), + "ok" : 1 + } + > \ No newline at end of file From fc06f488e63350f87ac4f059d397c07745a574be Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 10:33:40 -0500 Subject: [PATCH 2/8] DOCS-1069 add versionadded directive --- source/reference/command/hashBSONElement.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt index 8ca7396d8e2..43492ad8420 100644 --- a/source/reference/command/hashBSONElement.txt +++ b/source/reference/command/hashBSONElement.txt @@ -8,6 +8,8 @@ _hashBSONElement (internal) .. 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. From 8347a97d99f3ad5644c76849b6585bffc7384d52 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 14:14:49 -0500 Subject: [PATCH 3/8] DOCS-1069 address comments from @tychoish --- source/reference/command/hashBSONElement.txt | 36 +++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt index 43492ad8420..b45b68102c7 100644 --- a/source/reference/command/hashBSONElement.txt +++ b/source/reference/command/hashBSONElement.txt @@ -1,12 +1,10 @@ -.. _hashBSONElement: - =========================== _hashBSONElement (internal) =========================== .. default-domain:: mongodb -.. dbcommand:: _hashBSONElement() +.. dbcommand:: _hashBSONElement .. versionaddded:: 2.3.2 @@ -19,11 +17,16 @@ _hashBSONElement (internal) :param integer seed: specifies a seed to use to compute the hash. :returns: A document consisting of ``key``, ``seed``, ``out`` - and ``ok`` fields. + and ``ok`` fields. - :dbcommand:`_hashBSONElement` is an internal command which must be - explicitly enabled on the :program:`mongod` command line using the - :option:`mongod --setParameter` option: + :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:: @@ -33,21 +36,36 @@ _hashBSONElement (internal) .. 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 + } \ No newline at end of file From 82c722b753c109fac7708e49ccdd2d9bb3476ae0 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 14:16:39 -0500 Subject: [PATCH 4/8] DOCS-975 DOCS-863 document --setParameter and test commands --- source/includes/note-enabletestcommands.rst | 7 +++ source/reference/command/captrunc.txt | 35 +++++++++++++ .../reference/command/configureFailPoint.txt | 21 ++++++++ source/reference/command/emptyCapped.txt | 9 ++-- source/reference/command/godinsert.txt | 4 ++ .../reference/command/journalLatencyTest.txt | 3 ++ source/reference/command/replSetTest.txt | 5 ++ source/reference/command/setParameter.txt | 52 ++++++++++++++++++- source/reference/command/skewClockCommand.txt | 3 ++ source/reference/command/sleep.txt | 3 ++ .../command/testDistLockWithSkew.txt | 3 ++ .../command/testDistLockWithSyncCluster.txt | 3 ++ source/reference/mongod.txt | 30 +++++++++++ 13 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 source/includes/note-enabletestcommands.rst create mode 100644 source/reference/command/captrunc.txt create mode 100644 source/reference/command/configureFailPoint.txt 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/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 4e529660e80..4f785eb2b1c 100644 --- a/source/reference/mongod.txt +++ b/source/reference/mongod.txt @@ -380,6 +380,36 @@ Options for the :option:`--repair` operation. Defaults to the value specified by :option:`--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:: --slowms Defines the value of "slow," for the :option:`--profile` From a2a46816efddbbd5e0f626d1133faba314901308 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Tue, 12 Feb 2013 17:44:47 -0500 Subject: [PATCH 5/8] DOCS-1069 document _hashBSONElement command --- source/reference/command/hashBSONElement.txt | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 source/reference/command/hashBSONElement.txt diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt new file mode 100644 index 00000000000..8ca7396d8e2 --- /dev/null +++ b/source/reference/command/hashBSONElement.txt @@ -0,0 +1,51 @@ +.. _hashBSONElement: + +=========================== +_hashBSONElement (internal) +=========================== + +.. default-domain:: mongodb + +.. dbcommand:: _hashBSONElement() + + :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. + + :dbcommand:`_hashBSONElement` is an internal command which must be + explicitly enabled on the :program:`mongod` command line using the + :option:`mongod --setParameter` option: + + .. example:: + + .. code-block:: sh + + mongod --setParameter=enableTestCommands=1 + + .. example:: + + .. code-block:: javascript + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z")}) + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 0, + "out" : NumberLong("-4185544074338741873"), + "ok" : 1 + } + + > db.runCommand({_hashBSONElement: ISODate("2013-02-12T22:12:57.211Z"), seed:2013}) + { + "key" : ISODate("2013-02-12T22:12:57.211Z"), + "seed" : 2013, + "out" : NumberLong("7845924651247493302"), + "ok" : 1 + } + > \ No newline at end of file From fb1aab31bf98440e788f4210d56213e559259e11 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 10:33:40 -0500 Subject: [PATCH 6/8] DOCS-1069 add versionadded directive --- source/reference/command/hashBSONElement.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt index 8ca7396d8e2..43492ad8420 100644 --- a/source/reference/command/hashBSONElement.txt +++ b/source/reference/command/hashBSONElement.txt @@ -8,6 +8,8 @@ _hashBSONElement (internal) .. 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. From c34cc43a581981db489908fa74be0d8475c52b26 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 14:14:49 -0500 Subject: [PATCH 7/8] DOCS-1069 address comments from @tychoish --- source/reference/command/hashBSONElement.txt | 36 +++++++++++++++----- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/source/reference/command/hashBSONElement.txt b/source/reference/command/hashBSONElement.txt index 43492ad8420..b45b68102c7 100644 --- a/source/reference/command/hashBSONElement.txt +++ b/source/reference/command/hashBSONElement.txt @@ -1,12 +1,10 @@ -.. _hashBSONElement: - =========================== _hashBSONElement (internal) =========================== .. default-domain:: mongodb -.. dbcommand:: _hashBSONElement() +.. dbcommand:: _hashBSONElement .. versionaddded:: 2.3.2 @@ -19,11 +17,16 @@ _hashBSONElement (internal) :param integer seed: specifies a seed to use to compute the hash. :returns: A document consisting of ``key``, ``seed``, ``out`` - and ``ok`` fields. + and ``ok`` fields. - :dbcommand:`_hashBSONElement` is an internal command which must be - explicitly enabled on the :program:`mongod` command line using the - :option:`mongod --setParameter` option: + :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:: @@ -33,21 +36,36 @@ _hashBSONElement (internal) .. 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 + } \ No newline at end of file From 05c28c37baebc54551f05fb4ebf8391b644e3549 Mon Sep 17 00:00:00 2001 From: Ed Costello Date: Wed, 13 Feb 2013 14:16:39 -0500 Subject: [PATCH 8/8] DOCS-975 DOCS-863 document --setParameter and test commands --- source/includes/note-enabletestcommands.rst | 7 +++ source/reference/command/captrunc.txt | 35 +++++++++++++ .../reference/command/configureFailPoint.txt | 21 ++++++++ source/reference/command/emptycapped.txt | 9 ++-- source/reference/command/godinsert.txt | 4 ++ .../reference/command/journalLatencyTest.txt | 3 ++ source/reference/command/replSetTest.txt | 5 ++ source/reference/command/setParameter.txt | 52 ++++++++++++++++++- source/reference/command/skewClockCommand.txt | 3 ++ source/reference/command/sleep.txt | 3 ++ .../command/testDistLockWithSkew.txt | 3 ++ .../command/testDistLockWithSyncCluster.txt | 3 ++ source/reference/mongod.txt | 30 +++++++++++ 13 files changed, 173 insertions(+), 5 deletions(-) create mode 100644 source/includes/note-enabletestcommands.rst create mode 100644 source/reference/command/captrunc.txt create mode 100644 source/reference/command/configureFailPoint.txt 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/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..219efc44984 100644 --- a/source/reference/mongod.txt +++ b/source/reference/mongod.txt @@ -390,6 +390,36 @@ 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:: --slowms Defines the value of "slow," for the :option:`--profile`