Method Insert
Insert<TNominalType>(TNominalType)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert<TNominalType>(TNominalType document)
Parameters
document
TNominalTypeThe document to insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalType
The nominal type of the document to insert.
Insert<TNominalType>(TNominalType, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert<TNominalType>(TNominalType document, MongoInsertOptions options)
Parameters
document
TNominalTypeThe document to insert.
options
MongoInsertOptionsThe options to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalType
The nominal type of the document to insert.
Insert<TNominalType>(TNominalType, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert<TNominalType>(TNominalType document, WriteConcern writeConcern)
Parameters
document
TNominalTypeThe document to insert.
writeConcern
WriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalType
The nominal type of the document to insert.
Insert(Type, object)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(Type nominalType, object document)
Parameters
nominalType
TypeThe nominal type of the document to insert.
document
objectThe document to insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Insert(Type, object, MongoInsertOptions)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(Type nominalType, object document, MongoInsertOptions options)
Parameters
nominalType
TypeThe nominal type of the document to insert.
document
objectThe document to insert.
options
MongoInsertOptionsThe options to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Insert(Type, object, WriteConcern)
Inserts a document into this collection (see also InsertBatch to insert multiple documents at once).
public virtual WriteConcernResult Insert(Type nominalType, object document, WriteConcern writeConcern)
Parameters
nominalType
TypeThe nominal type of the document to insert.
document
objectThe document to insert.
writeConcern
WriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).