Table of Contents

Method Rename

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Rename<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, string)

Combines an existing update with a field renaming operator.

public static UpdateDefinition<TDocument> Rename<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, string newName)

Parameters

update UpdateDefinition<TDocument>

The update.

field FieldDefinition<TDocument>

The field.

newName string

The new name.

Returns

UpdateDefinition<TDocument>

A combined update.

Type Parameters

TDocument

The type of the document.

Rename<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>, string)

Combines an existing update with a field renaming operator.

public static UpdateDefinition<TDocument> Rename<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field, string newName)

Parameters

update UpdateDefinition<TDocument>

The update.

field Expression<Func<TDocument, object>>

The field.

newName string

The new name.

Returns

UpdateDefinition<TDocument>

A combined update.

Type Parameters

TDocument

The type of the document.