Method InsertOne
InsertOne(TDocument, InsertOneOptions, CancellationToken)
Inserts a single document.
void InsertOne(TDocument document, InsertOneOptions options = null, CancellationToken cancellationToken = default)
Parameters
documentTDocumentThe document.
optionsInsertOneOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.
InsertOne(IClientSessionHandle, TDocument, InsertOneOptions, CancellationToken)
Inserts a single document.
void InsertOne(IClientSessionHandle session, TDocument document, InsertOneOptions options = null, CancellationToken cancellationToken = default)
Parameters
sessionIClientSessionHandleThe session.
documentTDocumentThe document.
optionsInsertOneOptionsThe options.
cancellationTokenCancellationTokenThe cancellation token.