Document layer document says renameCollection should work , I tried but does not seems to work Is there is way to do this in document layer
> db.adminCommand( { renameCollection: "vishaltest.stores", to : "vishaltest.stores123"})
{
"errmsg" : "no such cmd: renamecollection",
"bad cmd" : "{ renameCollection: "vishaltest.stores", to: "vishaltest.stores123" }",
"ok" : 0
}
> use vishaltest
switched to db vishaltest
> db.stores.renameCollection("stores1234")
{
"errmsg" : "no such cmd: renamecollection",
"bad cmd" : "{ renameCollection: "vishaltest.stores", to: "vishaltest.stores1234", dropTarget: false }",
"ok" : 0
}
>