Method InsertBatch
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
MongoInsertOptionsThe 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
WriteConcernThe 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
TypeThe nominal type of the documents to insert.
documents
IEnumerableThe 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
TypeThe nominal type of the documents to insert.
documents
IEnumerableThe documents to insert.
writeConcern
WriteConcernThe 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
TypeThe nominal type of the documents to insert.
documents
IEnumerableThe documents to insert.
options
MongoInsertOptionsThe options to use for this Insert.
Returns
- IEnumerable<WriteConcernResult>
A list of WriteConcernResults (or null if WriteConcern is disabled).