Show
Example:
db.runCommand({cloneCollection: 'mydb.map', from:'[source address]', query: { _id: 'TDL-TRIPWL-2013' }});
{ "ok" : 1 }
Above works even though .map collection exists.
db.runCommand({cloneCollection: 'mydb.category', from:'[source address]', query: { event_name: 'TDL-TRIPWL-2013' }});
{ "ok" : 0, "errmsg" : "collection already exists" }
But this does not...what is the difference?
I thought maybe it's the use of _id.. but this didn't work either:
db.runCommand({cloneCollection: 'mydb.category', from:'[source address]', query: { _id: ObjectId("5154d54aecfdf41427000041") }});
{ "ok" : 0, "errmsg" : "collection already exists" }
Info on my 2 collections:
{
"ns" : "rt01.map",
"count" : 9,
"size" : 7840,
"avgObjSize" : 871.1111111111111,
"storageSize" : 36864,
"numExtents" : 1,
"nindexes" : 1,
"lastExtentSize" : 36864,
"paddingFactor" : 1.0020000000000011,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 8176,
"indexSizes" : {
"_id_" : 8176
},
"ok" : 1
}
{
"ns" : "rt01.category",
"count" : 575,
"size" : 233208,
"avgObjSize" : 405.5791304347826,
"storageSize" : 696320,
"numExtents" : 4,
"nindexes" : 3,
"lastExtentSize" : 524288,
"paddingFactor" : 1.5120000000000196,
"systemFlags" : 1,
"userFlags" : 0,
"totalIndexSize" : 130816,
"indexSizes" : {
"_id_" : 32704,
"name_1_event_name_1" : 49056,
"event_name_1_name_1" : 49056
},
"ok" : 1
}