Table of Contents

Method Merge

Namespace
MongoDB.Bson
Assembly
MongoDB.Bson.dll

Merge(BsonDocument)

Merges another document into this one. Existing elements are not overwritten.

public virtual BsonDocument Merge(BsonDocument document)

Parameters

document BsonDocument

The other document.

Returns

BsonDocument

The document (so method calls can be chained).

Merge(BsonDocument, bool)

Merges another document into this one, specifying whether existing elements are overwritten.

public virtual BsonDocument Merge(BsonDocument document, bool overwriteExistingElements)

Parameters

document BsonDocument

The other document.

overwriteExistingElements bool

Whether to overwrite existing elements.

Returns

BsonDocument

The document (so method calls can be chained).