code: function docToValidate(validator, doc, generatedId) {                                                             // 434
    var ret = doc;                                                                                                  // 435
    if (validator.transform) {                                                                                      // 436
      ret = EJSON.clone(doc);                                                                                       // 437
      // If you set a server-side transform on your collection, then you don't get                                  //
      // to tell the difference between "client specified the ID" and "server                                       //
      // generated the ID", because transforms expect to get _id.  If you want to                                   //
      // do that check, you can do it with a specific                                                               //
      // `C.allow({insert: f, transform: null})` validator.                                                         //
      if (generatedId !== null) {                                                                                   // 443
        ret._id = generatedId;                                                                                      // 444
      }                                                                                                             // 445
      ret = validator.transform(ret);                                                                               // 446
    }                                                                                                               // 447
    return ret;                                                                                                     // 448
  }
docs: 432