[SERVER-9354] copyCollection cannot append namespaces with options Created: 15/Apr/13 Updated: 05/Apr/17 Resolved: 06/Mar/17 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Code |
| Affects Version/s: | 2.4.1 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Jeremy | Assignee: | Maria van Keulen |
| Resolution: | Done | Votes: | 0 |
| Labels: | neweng | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
linux centos 64bit |
||
| Backwards Compatibility: | Fully Compatible | |||||||||||||||||||||||||||||||||||||||||||||
| Operating System: | Linux | |||||||||||||||||||||||||||||||||||||||||||||
| Steps To Reproduce: | Example:
Above works even though .map collection exists.
But this does not...what is the difference? I thought maybe it's the use of _id.. but this didn't work either:
Info on my 2 collections:
|
|||||||||||||||||||||||||||||||||||||||||||||
| Sprint: | Storage 2017-03-27 | |||||||||||||||||||||||||||||||||||||||||||||
| Participants: |
| Description |
|
According to docs, cloneCollection "appends documents in the remote collection to the destination collection." if the collection already exists. I am seeing odd behavior when trying to do this. |
| Comments |
| Comment by Eric Milkie [ 15/Apr/13 ] | ||||||||
|
You could use mongodump and mongorestore with the --collection parameter to export and import the collection's data. | ||||||||
| Comment by Jeremy [ 15/Apr/13 ] | ||||||||
|
Is there a work around to override and clear that out so I can append to it? | ||||||||
| Comment by Eric Milkie [ 15/Apr/13 ] | ||||||||
|
It turns out that, due to a bug, creating a collection with the CreateCollection command will produce that "create" field in the namespace spec document. Such namespaces will not be clonable. | ||||||||
| Comment by Jeremy [ 15/Apr/13 ] | ||||||||
|
filtered by the to collections im working with:
| ||||||||
| Comment by Eric Milkie [ 15/Apr/13 ] | ||||||||
|
Looking at the code, it seems like we try to create the namespace on the destination if the source namespace has an options field in its description. Can you post the output of db.system.namespaces.find()? |