Table of Contents

Method Rename

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

Rename(FieldDefinition<TDocument>, string)

Creates a field renaming operator.

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

Parameters

field FieldDefinition<TDocument>

The field.

newName string

The new name.

Returns

UpdateDefinition<TDocument>

A field rename operator.

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

Creates a field renaming operator.

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

Parameters

field Expression<Func<TDocument, object>>

The field.

newName string

The new name.

Returns

UpdateDefinition<TDocument>

A field rename operator.