Table of Contents

Method InsertBatch

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

InsertBatch<TNominalType>(IEnumerable<TNominalType>)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch<TNominalType>(IEnumerable<TNominalType> documents)

Parameters

documents IEnumerable<TNominalType>

The documents to insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The type of the documents to insert.

InsertBatch<TNominalType>(IEnumerable<TNominalType>, MongoInsertOptions)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch<TNominalType>(IEnumerable<TNominalType> documents, MongoInsertOptions options)

Parameters

documents IEnumerable<TNominalType>

The documents to insert.

options MongoInsertOptions

The options to use for this Insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The type of the documents to insert.

InsertBatch<TNominalType>(IEnumerable<TNominalType>, WriteConcern)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch<TNominalType>(IEnumerable<TNominalType> documents, WriteConcern writeConcern)

Parameters

documents IEnumerable<TNominalType>

The documents to insert.

writeConcern WriteConcern

The write concern to use for this Insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).

Type Parameters

TNominalType

The type of the documents to insert.

InsertBatch(Type, IEnumerable)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch(Type nominalType, IEnumerable documents)

Parameters

nominalType Type

The nominal type of the documents to insert.

documents IEnumerable

The documents to insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).

InsertBatch(Type, IEnumerable, WriteConcern)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch(Type nominalType, IEnumerable documents, WriteConcern writeConcern)

Parameters

nominalType Type

The nominal type of the documents to insert.

documents IEnumerable

The documents to insert.

writeConcern WriteConcern

The write concern to use for this Insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).

InsertBatch(Type, IEnumerable, MongoInsertOptions)

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

public virtual IEnumerable<WriteConcernResult> InsertBatch(Type nominalType, IEnumerable documents, MongoInsertOptions options)

Parameters

nominalType Type

The nominal type of the documents to insert.

documents IEnumerable

The documents to insert.

options MongoInsertOptions

The options to use for this Insert.

Returns

IEnumerable<WriteConcernResult>

A list of WriteConcernResults (or null if WriteConcern is disabled).