Details
-
Bug
-
Resolution: Done
-
Minor - P4
-
None
-
None
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.:
[nelhage@anarchique:/tmp/mongo]$ mongo --port 9001
|
MongoDB shell version: 2.4.3
|
connecting to: 127.0.0.1:9001/test
|
> use testdb
|
switched to db testdb
|
> db.runCommand({cloneCollection: "nelhage.mydb", from: "localhost:9000"})
|
{ "ok" : 1 }
|
> db.mydb.find()
|
> db.getSiblingDB('nelhage').mydb.find()
|
{ "_id" : ObjectId("51df57ffacab3e1ad799d62e"), "i" : 6 }
|