MongoDB.Database.RenameCollection C# (CSharp) Method

RenameCollection() public method

public RenameCollection ( string oldName, string newName ) : void
oldName string
newName string
return void
        public void RenameCollection(string oldName, string newName)
        {
            Contract.Requires(Collection.NameOk(newName));
              Contract.Requires(!newName.Contains('$'));
              var cmd = new Command("renameCollection", string.Format("{0}.{1}", Name, oldName))
            { { "to", string.Format("{0}.{1}", Name, newName) } };
              Admin.ExecuteCommand(cmd);
        }