@@ -2269,7 +2269,7 @@ Query.prototype._find = async function _find() {
2269
2269
const filter = this . _conditions ;
2270
2270
const fields = options . projection ;
2271
2271
2272
- const cursor = await this . _collection . collection . find ( filter , options ) ;
2272
+ const cursor = await this . mongooseCollection . find ( filter , options ) ;
2273
2273
if ( options . explain ) {
2274
2274
return cursor . explain ( ) ;
2275
2275
}
@@ -2516,7 +2516,7 @@ Query.prototype._findOne = async function _findOne() {
2516
2516
this . _applyTranslateAliases ( options ) ;
2517
2517
2518
2518
// don't pass in the conditions because we already merged them in
2519
- const doc = await this . _collection . collection . findOne ( this . _conditions , options ) ;
2519
+ const doc = await this . mongooseCollection . findOne ( this . _conditions , options ) ;
2520
2520
return new Promise ( ( resolve , reject ) => {
2521
2521
this . _completeOne ( doc , null , _wrapThunkCallback ( this , ( err , res ) => {
2522
2522
if ( err ) {
@@ -2614,7 +2614,7 @@ Query.prototype._countDocuments = async function _countDocuments() {
2614
2614
2615
2615
const conds = this . _conditions ;
2616
2616
2617
- return this . _collection . collection . countDocuments ( conds , options ) ;
2617
+ return this . mongooseCollection . countDocuments ( conds , options ) ;
2618
2618
} ;
2619
2619
2620
2620
/*!
@@ -2659,7 +2659,7 @@ Query.prototype._estimatedDocumentCount = async function _estimatedDocumentCount
2659
2659
2660
2660
const options = this . _optionsForExec ( ) ;
2661
2661
2662
- return this . _collection . collection . estimatedDocumentCount ( options ) ;
2662
+ return this . mongooseCollection . estimatedDocumentCount ( options ) ;
2663
2663
} ;
2664
2664
2665
2665
/**
@@ -2780,7 +2780,7 @@ Query.prototype.__distinct = async function __distinct() {
2780
2780
const options = this . _optionsForExec ( ) ;
2781
2781
this . _applyTranslateAliases ( options ) ;
2782
2782
2783
- return this . _collection . collection .
2783
+ return this . mongooseCollection .
2784
2784
distinct ( this . _distinct , this . _conditions , options ) ;
2785
2785
} ;
2786
2786
@@ -2998,7 +2998,7 @@ Query.prototype._deleteOne = async function _deleteOne() {
2998
2998
const options = this . _optionsForExec ( ) ;
2999
2999
this . _applyTranslateAliases ( options ) ;
3000
3000
3001
- return this . _collection . collection . deleteOne ( this . _conditions , options ) ;
3001
+ return this . mongooseCollection . deleteOne ( this . _conditions , options ) ;
3002
3002
} ;
3003
3003
3004
3004
/**
@@ -3072,7 +3072,7 @@ Query.prototype._deleteMany = async function _deleteMany() {
3072
3072
const options = this . _optionsForExec ( ) ;
3073
3073
this . _applyTranslateAliases ( options ) ;
3074
3074
3075
- return this . _collection . collection . deleteMany ( this . _conditions , options ) ;
3075
+ return this . mongooseCollection . deleteMany ( this . _conditions , options ) ;
3076
3076
} ;
3077
3077
3078
3078
/**
@@ -3326,7 +3326,7 @@ Query.prototype._findOneAndUpdate = async function _findOneAndUpdate() {
3326
3326
this . _update = this . _update . toBSON ( ) ;
3327
3327
}
3328
3328
3329
- let res = await this . _collection . collection . findOneAndUpdate ( this . _conditions , this . _update , options ) ;
3329
+ let res = await this . mongooseCollection . findOneAndUpdate ( this . _conditions , this . _update , options ) ;
3330
3330
for ( const fn of this . _transforms ) {
3331
3331
res = fn ( res ) ;
3332
3332
}
@@ -3422,7 +3422,7 @@ Query.prototype._findOneAndDelete = async function _findOneAndDelete() {
3422
3422
const options = this . _optionsForExec ( this . model ) ;
3423
3423
this . _applyTranslateAliases ( options ) ;
3424
3424
3425
- let res = await this . _collection . collection . findOneAndDelete ( filter , options ) ;
3425
+ let res = await this . mongooseCollection . findOneAndDelete ( filter , options ) ;
3426
3426
for ( const fn of this . _transforms ) {
3427
3427
res = fn ( res ) ;
3428
3428
}
@@ -3576,7 +3576,7 @@ Query.prototype._findOneAndReplace = async function _findOneAndReplace() {
3576
3576
throw validationError ;
3577
3577
}
3578
3578
3579
- let res = await this . _collection . collection . findOneAndReplace ( filter , this . _update , options ) ;
3579
+ let res = await this . mongooseCollection . findOneAndReplace ( filter , this . _update , options ) ;
3580
3580
3581
3581
for ( const fn of this . _transforms ) {
3582
3582
res = fn ( res ) ;
@@ -3790,7 +3790,7 @@ async function _updateThunk(op) {
3790
3790
this . _update = this . _update . toBSON ( ) ;
3791
3791
}
3792
3792
3793
- return this . _collection . collection [ op ] ( castedQuery , this . _update , options ) ;
3793
+ return this . mongooseCollection [ op ] ( castedQuery , this . _update , options ) ;
3794
3794
}
3795
3795
3796
3796
/**
0 commit comments