public void Update(object document, object selector, UpdateFlags flags){ var writerSettings = _configuration.SerializationFactory.GetBsonWriterSettings(typeof(T)); try { _connection.SendMessage(new UpdateMessage(writerSettings) { FullCollectionName = FullName, Selector = selector, Document = document, Flags = (int)flags }, DatabaseName); } catch (IOException exception) { throw new MongoConnectionException("Could not update document, communication failure", _connection, exception); } }
这是源码。