Skip to content

Commit 76ab37e

Browse files
committed
DOCS-12222: 4.2 - deprecate cloneCollection
1 parent ed8f454 commit 76ab37e

File tree

3 files changed

+29
-3
lines changed

3 files changed

+29
-3
lines changed

source/reference/command/cloneCollection.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Definition
1515

1616
.. dbcommand:: cloneCollection
1717

18+
.. deprecated:: 4.2
19+
20+
MongoDB deprecates :dbcommand:`cloneCollection` and its helper
21+
:method:`db.cloneCollection()`. For alternatives, see
22+
:ref:`4.2-compat-clone-collection`.
23+
1824
Copies a collection from a remote :binary:`~bin.mongod` instance to the
1925
current :binary:`~bin.mongod` instance. :dbcommand:`cloneCollection`
2026
creates a collection in a database with the same name as the remote
@@ -33,7 +39,7 @@ Definition
3339

3440
.. include:: /includes/apiargs/dbcommand-cloneCollection-field.rst
3541

36-
The :program:`mongo` shell provides the method
42+
The :binary:`~bin.mongo` shell provides the method
3743
:method:`db.cloneCollection()` as a wrapper for the
3844
:dbcommand:`cloneCollection` command.
3945

source/reference/method/db.cloneCollection.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@ Definition
1515

1616
.. method:: db.cloneCollection(from, collection, query)
1717

18+
.. deprecated:: 4.2
19+
20+
MongoDB deprecates :dbcommand:`cloneCollection` and its helper
21+
:method:`db.cloneCollection()`. For alternatives, see
22+
:ref:`4.2-compat-clone-collection`.
23+
1824
Copies data directly between MongoDB instances. The
1925
:method:`db.cloneCollection()` method wraps the
2026
:dbcommand:`cloneCollection` command and accepts the

source/release-notes/4.2-compatibility.txt

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,8 @@ MongoDB removes the MMAPv1 specific options:
9595
- ``paddingFactor``, ``paddingBytes``, ``preservePadding`` for
9696
:method:`db.createCollection()`.
9797

98-
Removed Commands and Methods
99-
----------------------------
98+
Removed or Deprecated Commands and Methods
99+
------------------------------------------
100100

101101
.. _4.2-compat-remove-group:
102102

@@ -218,6 +218,20 @@ As alternatives:
218218
:doc:`/tutorial/recover-data-following-unexpected-shutdown` for
219219
details.
220220

221+
.. _4.2-compat-clone-collection:
222+
223+
Deprecate Support for ``cloneCollection``
224+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
225+
226+
MongoDB deprecates the :dbcommand:`cloneCollection` command and its
227+
:binary:`~bin.mongo` shell helper :method:`db.cloneCollection()`
228+
229+
As alternatives,
230+
231+
- Users can use the :pipeline:`$out` aggregation stage.
232+
233+
- Users can use :binary:`~bin.mongoexport` and
234+
:binary:`~bin.mongoimport` or write a script using the drivers.
221235

222236
Aggregation
223237
-----------

0 commit comments

Comments
 (0)