@@ -44,7 +44,6 @@ function AggregationCursor(agg) {
4444 const model = agg . _model ;
4545 delete agg . options . cursor . useMongooseAggCursor ;
4646 this . _mongooseOptions = { } ;
47- this . options = { } ;
4847
4948 _init ( model , this , agg ) ;
5049}
@@ -58,25 +57,21 @@ util.inherits(AggregationCursor, Readable);
5857function _init ( model , c , agg ) {
5958 if ( ! model . collection . buffer ) {
6059 model . hooks . execPre ( 'aggregate' , agg , function ( ) {
61- Object . assign ( c . options , agg . _optionsForExec ( ) ) ;
62-
6360 if ( typeof agg . options ?. cursor ?. transform === 'function' ) {
6461 c . _transforms . push ( agg . options . cursor . transform ) ;
6562 }
6663
67- c . cursor = model . collection . aggregate ( agg . _pipeline , c . options || { } ) ;
64+ c . cursor = model . collection . aggregate ( agg . _pipeline , agg . options || { } ) ;
6865 c . emit ( 'cursor' , c . cursor ) ;
6966 } ) ;
7067 } else {
7168 model . collection . emitter . once ( 'queue' , function ( ) {
7269 model . hooks . execPre ( 'aggregate' , agg , function ( ) {
73- Object . assign ( c . options , agg . _optionsForExec ( ) ) ;
74-
7570 if ( typeof agg . options ?. cursor ?. transform === 'function' ) {
7671 c . _transforms . push ( agg . options . cursor . transform ) ;
7772 }
7873
79- c . cursor = model . collection . aggregate ( agg . _pipeline , c . options || { } ) ;
74+ c . cursor = model . collection . aggregate ( agg . _pipeline , agg . options || { } ) ;
8075 c . emit ( 'cursor' , c . cursor ) ;
8176 } ) ;
8277 } ) ;
0 commit comments