@@ -842,7 +842,7 @@ function init(self, obj, doc, opts, prefix) {
842842 */
843843
844844Document . prototype . updateOne = function updateOne ( doc , options , callback ) {
845- const query = this . constructor . updateOne ( { _id : this . _id } , doc , options ) ;
845+ const query = this . constructor . updateOne ( { _id : this . _doc . _id } , doc , options ) ;
846846 const self = this ;
847847 query . pre ( function queryPreUpdateOne ( cb ) {
848848 self . constructor . _middleware . execPre ( 'updateOne' , self , [ self ] , cb ) ;
@@ -883,7 +883,7 @@ Document.prototype.updateOne = function updateOne(doc, options, callback) {
883883
884884Document . prototype . replaceOne = function replaceOne ( ) {
885885 const args = [ ...arguments ] ;
886- args . unshift ( { _id : this . _id } ) ;
886+ args . unshift ( { _id : this . _doc . _id } ) ;
887887 return this . constructor . replaceOne . apply ( this . constructor , args ) ;
888888} ;
889889
@@ -3050,7 +3050,7 @@ Document.prototype.$__validate = function(pathsToValidate, options, callback) {
30503050 } else if ( val != null && val . $__ != null && val . $__ . wasPopulated ) {
30513051 // Array paths, like `somearray.1`, do not show up as populated with `$populated()`,
30523052 // so in that case pull out the document's id
3053- val = val . _id ;
3053+ val = val . _doc . _id ;
30543054 }
30553055 const scope = _this . $__ . pathsToScopes != null && path in _this . $__ . pathsToScopes ?
30563056 _this . $__ . pathsToScopes [ path ] :
0 commit comments