Table of Contents

Method InsertBatch

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

InsertBatch(IEnumerable<TDefaultDocument>)

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

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

Parameters

documents IEnumerable<TDefaultDocument>

The documents to insert.

Returns

IEnumerable<WriteConcernResult>

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

InsertBatch(IEnumerable<TDefaultDocument>, MongoInsertOptions)

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

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

Parameters

documents IEnumerable<TDefaultDocument>

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).

InsertBatch(IEnumerable<TDefaultDocument>, WriteConcern)

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

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

Parameters

documents IEnumerable<TDefaultDocument>

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).