I think you’re looking for ReplaceOneAsync()
:
MyType myObject; // passed in
var filter = Builders<MyType>.Filter.Eq(s => s.Id, id);
var result = await collection.ReplaceOneAsync(filter, myObject)
More Related Contents:
- BsonSerializationException when serializing a Dictionary to BSON
- Mongodb query equivalent of the following SQL query
- MongoDB GridFs with C#, how to store files such as images?
- Aggregate $lookup with C#
- MongoDB .Net driver 2.0 Pull (remove element)
- Is there an “Explain Query” for MongoDB Linq?
- MongoDB and C#: Case insensitive search
- Get _id of an inserted document in MongoDB?
- In sqlite I would do, But how in mongodb c#
- A timeout occured after 30000ms selecting a server using CompositeServerSelector
- How to use decimal type in MongoDB
- JSON.NET cast error when serializing Mongo ObjectId
- Generating permutations of a set (most efficiently)
- Populating a razor dropdownlist from a List in MVC
- How can you clone a WPF object?
- Method Call using Ternary Operator
- Enabling c# 7 in a asp.net application
- Invalid attempt to read when no data is present
- Send email using System.Net.Mail through gmail
- DataContract XML serialization and XML attributes
- How can I create a temp file with a specific extension with .NET?
- event Action vs event EventHandler
- Check for any element that exists in two collections
- What is Func, how and when is it used
- Run .exe executable file in Azure Function
- What are the most important functional differences between C# and VB.NET?
- Options for using System.Data.SQLite in a 32bit and 64bit C# world
- .NET Short Unique Identifier
- Differences in development between .NET and Mono
- What is the difference between Property and Dependency Property