Table of Contents

Method CurrentDate

Namespace
MongoDB.Driver
Assembly
MongoDB.Driver.dll

CurrentDate<TDocument>(UpdateDefinition<TDocument>, FieldDefinition<TDocument>, UpdateDefinitionCurrentDateType?)

Combines an existing update with a current date operator.

public static UpdateDefinition<TDocument> CurrentDate<TDocument>(this UpdateDefinition<TDocument> update, FieldDefinition<TDocument> field, UpdateDefinitionCurrentDateType? type = null)

Parameters

update UpdateDefinition<TDocument>

The update.

field FieldDefinition<TDocument>

The field.

type UpdateDefinitionCurrentDateType?

The type.

Returns

UpdateDefinition<TDocument>

A combined update.

Type Parameters

TDocument

The type of the document.

CurrentDate<TDocument>(UpdateDefinition<TDocument>, Expression<Func<TDocument, object>>, UpdateDefinitionCurrentDateType?)

Combines an existing update with a current date operator.

public static UpdateDefinition<TDocument> CurrentDate<TDocument>(this UpdateDefinition<TDocument> update, Expression<Func<TDocument, object>> field, UpdateDefinitionCurrentDateType? type = null)

Parameters

update UpdateDefinition<TDocument>

The update.

field Expression<Func<TDocument, object>>

The field.

type UpdateDefinitionCurrentDateType?

The type.

Returns

UpdateDefinition<TDocument>

A combined update.

Type Parameters

TDocument

The type of the document.