Skip to content

Commit df35f1f

Browse files
jocelyn-mendez1Jocelyn Mendez
andauthored
DOCS-15230 changeStreamOptions cluster parameter (#1149)
* DOCS-15230 changeStreamOptions cluster parameter * DOCS-15230 added release note * DOCS-15230 fixed accidental deletion * DOCS-15230 internal feedback * DOCS-15230 rearranging description * DOCS-15230 cluster parameter * DOCS-15230 cluster parameter * DOCS-15230 cluster parameter * DOCS-15230 cluster parameter * DOCS-15230 nit change * DOCS-15230 restructuring parameter * DOCS-15230 restructuring parameter * DOCS-15230 restructuring parameter * DOCS-15230 restructuring parameter * DOCS-15230 restructuring parameter * DOCS-15230 mongos & mongod * DOCS-15230 add replace * DOCS-15230 zoom changes * DOCS-15230 correcting to mongos * DOCS-15230 tech feedback * DOCS-15230 updating ref link * DOCS-15230 updating ref link * DOCS-15230 updating ref link * DOCS-15230 updating ref Co-authored-by: Jocelyn Mendez <[email protected]>
1 parent e7a1155 commit df35f1f

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

source/reference/cluster-parameters.txt

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,55 @@ To view the current values of cluster parameters, use the
3232

3333
Parameters
3434
----------
35+
36+
.. |mongod-only| replace:: Available for :binary:`~bin.mongod` only.
37+
38+
.. |mongos-only| replace:: Available for :binary:`~bin.mongos` only.
39+
40+
.. |both| replace:: Available for both :binary:`~bin.mongod` and :binary:`~bin.mongos`.
41+
42+
.. parameter:: changeStreamOptions
43+
44+
.. versionadded:: 6.0
45+
46+
|both|
47+
48+
This is an object containing :ref:`change stream <change-streams-update-event>`
49+
configuration options.
50+
51+
You can only set ``changeStreamOptions`` on mongos or a
52+
replica set primary. The value is set cluster-wide.
53+
54+
.. parameter:: changeStreamOptions.preAndPostImages.expireAfterSeconds
55+
56+
.. versionadded:: 6.0
57+
58+
*Default*: off
59+
60+
Controls the retention policy of change stream pre- and post-images.
61+
Pre- and post-images are the versions of a document before and after
62+
document modification respectively. ``expireAfterSeconds``
63+
controls how long pre- and post-images are retained.
64+
65+
When ``expireAfterSeconds`` is ``off``, MongoDB uses the default retention
66+
policy: pre- and post-images are retained until the corresponding change
67+
stream events are removed from the :term:`oplog`.
68+
69+
To specify the minimum pre- and post-image retention time:
70+
71+
- Set ``expireAfterSeconds`` using an integer.
72+
73+
- If a change stream event is removed from the oplog, then the
74+
corresponding pre- and post-images are also deleted regardless of the
75+
``expireAfterSeconds`` pre- and post-image retention time.
76+
77+
The following example sets the retention time for pre- and post-images in
78+
change streams to ``100 seconds``:
79+
80+
.. code-block:: javascript
81+
82+
db.runCommand( {
83+
setClusterParameter: {
84+
changeStreamOptions: { preAndPostImages: { expireAfterSeconds: 100 } }
85+
}
86+
} )

source/release-notes/6.0.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,17 @@ Starting in MongoDB 6.0, you can use
173173
minimum and maximum sharding TaskExecutor connection pool size for
174174
:ref:`configuration servers <sharding-config-server>`.
175175

176+
``changeStreamOptions`` Cluster Parameter
177+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
178+
179+
Starting in MongoDB 6.0, you can use :parameter:`changeStreamOptions` to control
180+
the retention policy of change stream pre- and post-images.
181+
182+
Multiple Arbiters Unsupported
183+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
184+
185+
.. include:: /includes/support-multiple-arbiters.rst
186+
176187
Clustered Collections
177188
---------------------
178189

0 commit comments

Comments
 (0)