我有以下通过旧的遗留 c# mongodb 驱动程序编写的代码:
var bulk = dbCollection.InitializeUnorderedBulkOperation();
foreach (var profile in profiles)
{
bulk.Find(Query.EQ("_id", profile.ID)).
Update(
Update.Pull("p2l",
Query.And(
Query.In("listId", new BsonArray(SourceMailLists))
))
);
}
bulk.Execute();
我想用它重写它,dbCollection.UpdateManyAsync
但是我如何实现一个Pull
条件listid
from p2l
collection 应该在 list 中SourceMailLists
,而且,我想用 typed 来实现它Builder
?