C# Update with Upsert Set object (not fields)

I work on bulk insert method ‘Add if not exists’;

How i can set full object to set ? i have big object , dont want enumarable all fields with method ‘Set’

var tag = new Tag { Id: 1,  many many fields};

     var f = Builders<Tag>.Filter.Eq(t => t.id, i.id);
     var u = Builders<Tag>.Update.Set( tag )  // ???
     return new UpdateOneModel<Tag>(f, u) { IsUpsert = true };
1 Like

Hi, I’m commenting as I am interested in the same question.

I think this should be done with ReplaceOneModel<T> instead?