MongoDB
 sql >> Database >  >> NoSQL >> MongoDB

MongoDB C# Driver 2.0 - Aggiorna documento

Penso che tu stia cercando ReplaceOneAsync() :

MyType myObject; // passed in 
var filter = Builders<MyType>.Filter.Eq(s => s.Id, id);
var result = await collection.ReplaceOneAsync(filter, myObject)