Table of Contents

Method Insert

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

Insert<TNominalType>(TNominalType)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert<TNominalType>(TNominalType document)

Parameters

document TNominalType

The document to insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The nominal type of the document to insert.

Insert<TNominalType>(TNominalType, MongoInsertOptions)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert<TNominalType>(TNominalType document, MongoInsertOptions options)

Parameters

document TNominalType

The document to insert.

options MongoInsertOptions

The options to use for this Insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The nominal type of the document to insert.

Insert<TNominalType>(TNominalType, WriteConcern)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert<TNominalType>(TNominalType document, WriteConcern writeConcern)

Parameters

document TNominalType

The document to insert.

writeConcern WriteConcern

The write concern to use for this Insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The nominal type of the document to insert.

Insert(Type, object)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert(Type nominalType, object document)

Parameters

nominalType Type

The nominal type of the document to insert.

document object

The document to insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).

Insert(Type, object, MongoInsertOptions)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert(Type nominalType, object document, MongoInsertOptions options)

Parameters

nominalType Type

The nominal type of the document to insert.

document object

The document to insert.

options MongoInsertOptions

The options to use for this Insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).

Insert(Type, object, WriteConcern)

Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).

public virtual WriteConcernResult Insert(Type nominalType, object document, WriteConcern writeConcern)

Parameters

nominalType Type

The nominal type of the document to insert.

document object

The document to insert.

writeConcern WriteConcern

The write concern to use for this Insert.

Returns

WriteConcernResult

A WriteConcernResult (or null if WriteConcern is disabled).