Use MarshalBSON, then init item := & model.File{}, item.Name = input.Name,… your updated field auto updated.

func (i *File) MarshalBSON() (byte, error) {
now := primitive.Timestamp{T: uint32(time.Now().Unix())}

if i.Created.IsZero() {
	i.Created = now
}

i.Updated = now
i.Nonce = primitive.NewObjectID()

type t File
return bson.Marshal((*t)(i))

}