db.copyDatabase('old_name', 'new_name'); use old_name db.dropDatabase();
db.adminCommand({renameCollection: "db.collection1", to: "db.collection2"})