Skip to content

Commit 52200e0

Browse files
devkevkay-kim
authored andcommitted
cloneCollection is not a viable alternative to copyTo
cloneCollection requires that the source and destination collections are on different mongods. copyTo only works to copy a collection within a database on a single mongod. Therefore, it is not possible to use cloneCollection instead of copyTo. As such, we should not suggest the use of cloneCollection where copyTo does not behave as desired, since cloneCollection cannot work for that purpose and it is misleading to suggest that it can. Signed-off-by: kay <kay.kim@10gen.com>
1 parent 9dc7289 commit 52200e0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

source/includes/warning-copyto-loss-of-type-fidelity.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
When using :method:`db.collection.copyTo()` check field types to
44
ensure that the operation does not remove type information from
55
documents during the translation from :term:`BSON` to
6-
:term:`JSON`. Consider using :method:`~db.cloneCollection()`
7-
to maintain type fidelity.
6+
:term:`JSON`.
87

98
The :method:`db.collection.copyTo()` method uses the :dbcommand:`eval`
109
command internally. As a result, the :method:`db.collection.copyTo()`

0 commit comments

Comments
 (0)