Yes you can rename the collection if required but it is not supported on sharded collections.

db.collection.renameCollection() 
db.collection.renameCollection();

db.test_my.renamecollection(“test”);

use admin
db.adminCommand( { renameCollection: “mydb.test_my”, to: “mydb.test” } )

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.