@@ -7,16 +7,13 @@ import type { Sort } from '../sort';
7
7
import type { Topology } from '../sdam/topology' ;
8
8
import type { Callback , MongoDBNamespace } from '../utils' ;
9
9
import type { ClientSession } from '../sessions' ;
10
- import type { OperationParent } from '../operations/command' ;
11
10
import type { AbstractCursorOptions } from './abstract_cursor' ;
12
11
import type { ExplainVerbosityLike } from '../explain' ;
13
12
import type { Projection } from '../mongo_types' ;
14
13
15
14
/** @public */
16
15
export interface AggregationCursorOptions extends AbstractCursorOptions , AggregateOptions { }
17
16
18
- /** @internal */
19
- const kParent = Symbol ( 'parent' ) ;
20
17
/** @internal */
21
18
const kPipeline = Symbol ( 'pipeline' ) ;
22
19
/** @internal */
@@ -30,24 +27,20 @@ const kOptions = Symbol('options');
30
27
* @public
31
28
*/
32
29
export class AggregationCursor < TSchema = Document > extends AbstractCursor < TSchema > {
33
- /** @internal */
34
- [ kParent ] : OperationParent ; // TODO: NODE-2883
35
30
/** @internal */
36
31
[ kPipeline ] : Document [ ] ;
37
32
/** @internal */
38
33
[ kOptions ] : AggregateOptions ;
39
34
40
35
/** @internal */
41
36
constructor (
42
- parent : OperationParent ,
43
37
topology : Topology ,
44
38
namespace : MongoDBNamespace ,
45
39
pipeline : Document [ ] = [ ] ,
46
40
options : AggregateOptions = { }
47
41
) {
48
42
super ( topology , namespace , options ) ;
49
43
50
- this [ kParent ] = parent ;
51
44
this [ kPipeline ] = pipeline ;
52
45
this [ kOptions ] = options ;
53
46
}
@@ -59,7 +52,7 @@ export class AggregationCursor<TSchema = Document> extends AbstractCursor<TSchem
59
52
clone ( ) : AggregationCursor < TSchema > {
60
53
const clonedOptions = mergeOptions ( { } , this [ kOptions ] ) ;
61
54
delete clonedOptions . session ;
62
- return new AggregationCursor ( this [ kParent ] , this . topology , this . namespace , this [ kPipeline ] , {
55
+ return new AggregationCursor ( this . topology , this . namespace , this [ kPipeline ] , {
63
56
...clonedOptions
64
57
} ) ;
65
58
}
@@ -70,7 +63,7 @@ export class AggregationCursor<TSchema = Document> extends AbstractCursor<TSchem
70
63
71
64
/** @internal */
72
65
_initialize ( session : ClientSession | undefined , callback : Callback < ExecutionResult > ) : void {
73
- const aggregateOperation = new AggregateOperation ( this [ kParent ] , this [ kPipeline ] , {
66
+ const aggregateOperation = new AggregateOperation ( this . namespace , this [ kPipeline ] , {
74
67
...this [ kOptions ] ,
75
68
...this . cursorOptions ,
76
69
session
@@ -97,7 +90,7 @@ export class AggregationCursor<TSchema = Document> extends AbstractCursor<TSchem
97
90
98
91
return executeOperation (
99
92
this . topology ,
100
- new AggregateOperation ( this [ kParent ] , this [ kPipeline ] , {
93
+ new AggregateOperation ( this . namespace , this [ kPipeline ] , {
101
94
...this [ kOptions ] , // NOTE: order matters here, we may need to refine this
102
95
...this . cursorOptions ,
103
96
explain : verbosity
0 commit comments