Method Insert
Insert(TDefaultDocument)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(TDefaultDocument document)
Parameters
document
TDefaultDocumentThe document to insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Insert(TDefaultDocument, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(TDefaultDocument document, MongoInsertOptions options)
Parameters
document
TDefaultDocumentThe document to insert.
options
MongoInsertOptionsThe options to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Insert(TDefaultDocument, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(TDefaultDocument document, WriteConcern writeConcern)
Parameters
document
TDefaultDocumentThe document to insert.
writeConcern
WriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).