From 54f206a13646350596d4f46d4191b9ede97472e5 Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Thu, 7 Oct 2021 15:42:44 -0400 Subject: [PATCH 1/2] DOCS-13479 Add note for 5.1 out and merge behavior on RS --- .../reference/operator/aggregation/merge.txt | 20 ++++++++++++- source/reference/operator/aggregation/out.txt | 18 +++++++++++ source/release-notes/4.4.txt | 30 +++++++++++++++++-- 3 files changed, 64 insertions(+), 4 deletions(-) diff --git a/source/reference/operator/aggregation/merge.txt b/source/reference/operator/aggregation/merge.txt index fd1ca57fd78..3a65a093e81 100644 --- a/source/reference/operator/aggregation/merge.txt +++ b/source/reference/operator/aggregation/merge.txt @@ -39,10 +39,28 @@ Definition - Can output to a collection in the same or different database. - - Starting in MongoDB 4.4, :pipeline:`$merge` can output to the + - Starting in MongoDB 4.4: + + - :pipeline:`$merge` can output to the same collection that is being aggregated. For more information, see :ref:`merge-behavior-same-collection`. + - Pipelines with the :pipeline:`$merge` stage can run on + ``replica set secondary nodes`` if all the nodes in cluster have + :ref:`featureCompatibilityVersion ` set + to ``4.4`` or higher and the :doc:`/core/read-preference` + allows secondary reads. + + - Read operations of the :pipeline:`$merge` statement are sent to + ``secondary`` nodes, while the write operations occur only on the + ``primary`` nodes. + + - Not all driver versions support targeting of :pipeline:`$merge` + operations to replica set secondary nodes. Check your + :driver:`driver ` documentation to see when your driver added + support for :pipeline:`$merge` read operations running on + secondary nodes. + - Creates a new collection if the output collection does not already exist. diff --git a/source/reference/operator/aggregation/out.txt b/source/reference/operator/aggregation/out.txt index 873f211c139..b0ec4266e75 100644 --- a/source/reference/operator/aggregation/out.txt +++ b/source/reference/operator/aggregation/out.txt @@ -151,6 +151,24 @@ Comparison with ``$merge`` Behaviors --------- +$out Read Operations Run on Secondary Replica Set Members +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Starting in MongoDB 4.4, :pipeline:`$out` can run on +``replica set secondary nodes`` if all the nodes in +cluster have :ref:`featureCompatibilityVersion ` set +to ``4.4`` or higher and the :doc:`/core/read-preference` is set to +secondary. + +Read operations of the :pipeline:`$out` statement occur on the +``secondary`` nodes, while the write operations occur only on the +``primary`` nodes. + +Not all driver versions support targeting of :pipeline:`$out` +operations to replica set secondary nodes. Check your +:driver:`driver ` documentation to see when your driver added +support for :pipeline:`$out` running on a secondary. + Create New Collection ~~~~~~~~~~~~~~~~~~~~~ diff --git a/source/release-notes/4.4.txt b/source/release-notes/4.4.txt index be26ec15797..03022de2c91 100644 --- a/source/release-notes/4.4.txt +++ b/source/release-notes/4.4.txt @@ -387,9 +387,19 @@ General Aggregation Improvements ``$out`` ```````` -Starting in MongoDB 4.4, :pipeline:`$out` can output to a collection in -a different database. In earlier versions, :pipeline:`$out` can output -to a collection to the same database where the aggregation is run. +Starting in MongoDB 4.4: + +- :pipeline:`$out` can output to a collection in + a different database. In earlier versions, :pipeline:`$out` can only + output to a collection in the same database database where the + aggregation is run. + +- :pipeline:`$out` can only run on ``replica set secondary nodes`` if + all the nodes in cluster have + :ref:`featureCompatibilityVersion ` set to ``4.4`` or + higher and the :doc:`/core/read-preference` allows secondary reads. + Check your :driver:`driver ` documentation to see when your + driver added support. ``$indexStats`` ``````````````` @@ -417,6 +427,20 @@ Starting in MongoDB 4.4 (also available starting in 4.2.4), ``$merge`` `````````` +Starting in MongoDB 4.4: + +- :pipeline:`$merge` can output to a collection in + a different database. In earlier versions, :pipeline:`$merge` can + only output to a collection in the same database where the aggregation + is run. + +- :pipeline:`$merge` can only run on ``replica set secondary nodes`` if + all the nodes in cluster have + :ref:`featureCompatibilityVersion ` set to ``4.4`` or + higher and the :doc:`/core/read-preference` allows secondary reads. + Check your :driver:`driver ` documentation to see + when your driver added support. + .. include:: /includes/fact-merge-same-collection-behavior.rst .. include:: /includes/fact-merge-same-collection-warning.rst From 5db03c5fadafa05fcfc6ca740f511422b5713682 Mon Sep 17 00:00:00 2001 From: ian fogelman Date: Thu, 7 Oct 2021 15:42:44 -0400 Subject: [PATCH 2/2] DOCS-13479 Add note for 5.1 out and merge behavior on RS --- source/reference/operator/aggregation/merge.txt | 6 +++--- source/reference/operator/aggregation/out.txt | 6 +++--- source/release-notes/4.4.txt | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/source/reference/operator/aggregation/merge.txt b/source/reference/operator/aggregation/merge.txt index 3a65a093e81..984458c9239 100644 --- a/source/reference/operator/aggregation/merge.txt +++ b/source/reference/operator/aggregation/merge.txt @@ -46,14 +46,14 @@ Definition information, see :ref:`merge-behavior-same-collection`. - Pipelines with the :pipeline:`$merge` stage can run on - ``replica set secondary nodes`` if all the nodes in cluster have + replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` allows secondary reads. - Read operations of the :pipeline:`$merge` statement are sent to - ``secondary`` nodes, while the write operations occur only on the - ``primary`` nodes. + secondary nodes, while the write operations occur only on the + primary node. - Not all driver versions support targeting of :pipeline:`$merge` operations to replica set secondary nodes. Check your diff --git a/source/reference/operator/aggregation/out.txt b/source/reference/operator/aggregation/out.txt index b0ec4266e75..bef5df90744 100644 --- a/source/reference/operator/aggregation/out.txt +++ b/source/reference/operator/aggregation/out.txt @@ -155,14 +155,14 @@ $out Read Operations Run on Secondary Replica Set Members ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Starting in MongoDB 4.4, :pipeline:`$out` can run on -``replica set secondary nodes`` if all the nodes in +replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` is set to secondary. Read operations of the :pipeline:`$out` statement occur on the -``secondary`` nodes, while the write operations occur only on the -``primary`` nodes. +secondary nodes, while the write operations occur only on the +primary nodes. Not all driver versions support targeting of :pipeline:`$out` operations to replica set secondary nodes. Check your diff --git a/source/release-notes/4.4.txt b/source/release-notes/4.4.txt index 03022de2c91..061291ed008 100644 --- a/source/release-notes/4.4.txt +++ b/source/release-notes/4.4.txt @@ -394,7 +394,7 @@ Starting in MongoDB 4.4: output to a collection in the same database database where the aggregation is run. -- :pipeline:`$out` can only run on ``replica set secondary nodes`` if +- :pipeline:`$out` can only run on replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` allows secondary reads. @@ -434,7 +434,7 @@ Starting in MongoDB 4.4: only output to a collection in the same database where the aggregation is run. -- :pipeline:`$merge` can only run on ``replica set secondary nodes`` if +- :pipeline:`$merge` can only run on replica set secondary nodes if all the nodes in cluster have :ref:`featureCompatibilityVersion ` set to ``4.4`` or higher and the :doc:`/core/read-preference` allows secondary reads.