[DOCS-1698] cloneCollection always preserves db name in the destination DB Created: 12/Jul/13 Updated: 30/Oct/23 Resolved: 15/Jul/13 |
|
| Status: | Closed |
| Project: | Documentation |
| Component/s: | manual |
| Affects Version/s: | None |
| Fix Version/s: | Server_Docs_20231030 |
| Type: | Bug | Priority: | Minor - P4 |
| Reporter: | Nelson Elhage | Assignee: | Sam Kleinman (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: | |
| Days since reply: | 10 years, 31 weeks, 2 days ago |
| Description |
|
The documentation for cloneCollection documents that it "creates a collection on the current database with the same name as the origin collection.": http://docs.mongodb.org/manual/reference/command/cloneCollection/ However, testing and source inspection reveal that it always copies to the database of the same name as the source database, e.g.:
|
| Comments |
| Comment by auto [ 15/Jul/13 ] |
|
Author: {u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}Message: |
| Comment by J Rassi [ 12/Jul/13 ] |
|
We'll keep the command's default behavior as is; changing it would introduce a significant backwards-breaking change without very much benefit (also, the command's help method has always been correct on this point, but those are admittedly rarely used). Do feel free to open a separate SERVER ticket for your proposal, perhaps as a feature request for an new option to cloneCollection command. It's clear that the behavior you desire would make it easier to create quick backups of individual collections. |
| Comment by Nelson Elhage [ 12/Jul/13 ] |
|
Fixing the docs would definitely be preferable to keeping them wrong, but fwiw I found this because I wanted the documented behavior, so my 2ยข would be to vote for fixing the code instead of the docs (from reading the code, it doesn't look like it'd be fundamentally hard for any reason I can see – the internal copy API already takes two "ns" arguments). But it's your call, of course. |
| Comment by J Rassi [ 12/Jul/13 ] |
|
Confirmed as a documentation bug, moving to DOCS project. |