Table of Contents

Method Replace

Namespace
MongoDB.Driver.Builders
Assembly
MongoDB.Driver.Legacy.dll

Replace<TNominalType>(TNominalType)

Replaces the entire document with a new document (the _id must remain the same).

public static IMongoUpdate Replace<TNominalType>(TNominalType document)

Parameters

document TNominalType

The replacement document.

Returns

IMongoUpdate

An UpdateWrapper.

Type Parameters

TNominalType

The nominal type of the replacement document

Replace(Type, object)

Replaces the entire document with a new document (the _id must remain the same).

public static IMongoUpdate Replace(Type nominalType, object document)

Parameters

nominalType Type

The nominal type of the replacement document

document object

The replacement document.

Returns

IMongoUpdate

An UpdateWrapper.