[DOCS-7923] Incorrect example in db.cloneCollection() documentation Created: 20/May/16  Updated: 30/Oct/23  Resolved: 02/Nov/17

Status: Closed
Project: Documentation
Component/s: manual
Affects Version/s: None
Fix Version/s: Server_Docs_20231030

Type: Task Priority: Major - P3
Reporter: Kevin Adistambha Assignee: Kevin Adistambha
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 6 years, 14 weeks, 6 days ago
Story Points: 0.2

 Description   

The example for db.cloneCollection() at the page https://docs.mongodb.com/manual/reference/method/db.cloneCollection/ stated:

db.cloneCollection('mongodb.example.net:27017', 'users.profile',
                    { 'active' : true } )

The users.profile collection name is incorrect, since currently the db.cloneCollection() function auto-appends the current database name (https://github.com/mongodb/mongo/blob/v3.4/src/mongo/shell/db.js#L382).

The correct example should be (assuming we are in the users database):

db.cloneCollection('mongodb.example.net:27017', 'profile',
                    { 'active' : true } )



 Comments   
Comment by Githook User [ 02/Nov/17 ]

Author:

{'name': 'Kevin Adistambha', 'username': 'kevinadi', 'email': 'kevinadi@gmail.com'}

Message: DOCS-7923 Update db.cloneCollection() example

Signed-off-by: kay <kay.kim@10gen.com>
Branch: v3.4
https://github.com/mongodb/docs/commit/a16006067322dd94e40178cf3c0d1dbf13651a92

Comment by Githook User [ 02/Nov/17 ]

Author:

{'name': 'Kevin Adistambha', 'username': 'kevinadi', 'email': 'kevinadi@gmail.com'}

Message: DOCS-7923 Update db.cloneCollection() example

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/e6e645690c7e8d571daaf4b7358f0653530fe3f2

Generated at Thu Feb 08 07:55:17 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.