-
Type: New Feature
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 1.8
-
Component/s: None
This method is different from MongoDatabase.RenameCollection. One is an admin operation, the other isn't. I wrote an extension method that holds me over:
public static BsonValue RenameCollection<T>(this MongoCollection<T> collection, string newName)
{
var javascript = @"db.
.renameCollection('
{1}');".Inject(collection.Name, newName);
return collection.Database.Eval(BsonJavaScript.Create(javascript));
}