Is there a dead easy way to rename a collection in mongo? Something like:
db.originalCollectionName.rename(\'newCollectionName\');
And if
Assume that the database name is "mytestdb" and collection name is "orders". collection name change to orders2015 The simplest way is,
> use mytestdb > db.orders.renameCollection( "orders2015" )
Note : db.collection.renameCollection() is not supported on sharded collections.