I am trying to update a row in a (typed) MongoDB collection with the C# driver. When handling data of that particular collection of type MongoCollection
It´s possible to add more criterias in the Where-statement. Like this:
var db = ReferenceTreeDb.Database;
var packageCol = db.GetCollection("dotnetpackage");
var filter = Builders.Filter.Where(_ => _.packageName == packageItem.PackageName.ToLower() && _.isLatestVersion);
var update = Builders.Update.Set(_ => _.isLatestVersion, false);
var options = new FindOneAndUpdateOptions();
packageCol.FindOneAndUpdate(filter, update, options);