如何在mongo shell中创建表示此类写入关注设置的WriteConcern对象:
{w:“多数”,wtimeout:1000}WriteConcern.WMajority返回一个只读对象,因此不可能……
弄清楚了
WriteConcern.WValue wValue = WriteConcern.WMajority.W; TimeSpan? timeout = TimeSpan.FromMilliseconds(1000); WriteConcern concern = new WriteConcern(w: wValue, wTimeout: timeout);