2

我有以下通过旧的遗留 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条件listidfrom p2lcollection 应该在 list 中SourceMailLists,而且,我想用 typed 来实现它Builder

4

0 回答 0