Method InsertOne
InsertOne(TDocument, InsertOneOptions, CancellationToken)
Inserts a single document.
public virtual void InsertOne(TDocument document, InsertOneOptions options = null, CancellationToken cancellationToken = default)
Parameters
document
TDocumentThe document.
options
InsertOneOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.
InsertOne(IClientSessionHandle, TDocument, InsertOneOptions, CancellationToken)
Inserts a single document.
public virtual void InsertOne(IClientSessionHandle session, TDocument document, InsertOneOptions options = null, CancellationToken cancellationToken = default)
Parameters
session
IClientSessionHandleThe session.
document
TDocumentThe document.
options
InsertOneOptionsThe options.
cancellationToken
CancellationTokenThe cancellation token.