Method InsertBatch
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
MongoInsertOptionsThe 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
WriteConcernThe write concern to use for this Insert.
Returns
- IEnumerable<WriteConcernResult>
A list of WriteConcernResults (or null if WriteConcern is disabled).