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
documentTNominalTypeThe document to insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalTypeThe 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
documentTNominalTypeThe document to insert.
optionsMongoInsertOptionsThe options to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalTypeThe 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
documentTNominalTypeThe document to insert.
writeConcernWriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).
Type Parameters
TNominalTypeThe 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
nominalTypeTypeThe nominal type of the document to insert.
documentobjectThe 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
nominalTypeTypeThe nominal type of the document to insert.
documentobjectThe document to insert.
optionsMongoInsertOptionsThe 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
nominalTypeTypeThe nominal type of the document to insert.
documentobjectThe document to insert.
writeConcernWriteConcernThe write concern to use for this Insert.
Returns
- WriteConcernResult
A WriteConcernResult (or null if WriteConcern is disabled).