IMongoCollection<TDocument>.UpdateOne Method |
Updates a single document.
Namespace: MongoDB.DriverAssembly: MongoDB.Driver (in MongoDB.Driver.dll) Version: 2.4.1
SyntaxUpdateResult UpdateOne(
FilterDefinition<TDocument> filter,
UpdateDefinition<TDocument> update,
UpdateOptions options = null,
CancellationToken cancellationToken = null
)
Function UpdateOne (
filter As FilterDefinition(Of TDocument),
update As UpdateDefinition(Of TDocument),
Optional options As UpdateOptions = Nothing,
Optional cancellationToken As CancellationToken = Nothing
) As UpdateResult
abstract UpdateOne :
filter : FilterDefinition<'TDocument> *
update : UpdateDefinition<'TDocument> *
?options : UpdateOptions *
?cancellationToken : CancellationToken
(* Defaults:
let _options = defaultArg options null
let _cancellationToken = defaultArg cancellationToken null
*)
-> UpdateResult
Parameters
- filter
- Type: MongoDB.Driver.FilterDefinition<TDocument>
The filter. - update
- Type: MongoDB.Driver.UpdateDefinition<TDocument>
The update. - options (Optional)
- Type: MongoDB.Driver.UpdateOptions
The options. - cancellationToken (Optional)
- Type: System.Threading.CancellationToken
The cancellation token.
Return Value
Type:
UpdateResult
The result of the update operation.
See Also
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant