Skip to content

Commit 7c712d1

Browse files
authored
Create cursors with expected Mongo instance (link to Collection and to Database used was used) (#340)
1 parent 479a634 commit 7c712d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/shell-api/src/collection.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ export default class Collection extends ShellApiClass {
115115
providerOptions,
116116
dbOptions
117117
);
118-
const cursor = new AggregationCursor(this, providerCursor);
118+
const cursor = new AggregationCursor(this._mongo, providerCursor);
119119

120120
if (explain) {
121121
return await cursor.explain('queryPlanner'); // TODO: set default or use optional argument
@@ -341,7 +341,7 @@ export default class Collection extends ShellApiClass {
341341

342342
this._emitCollectionApiCall('find', { query, options });
343343
const cursor = new Cursor(
344-
this,
344+
this._mongo,
345345
this._mongo._serviceProvider.find(this._database._name, this._name, query, options)
346346
);
347347

packages/shell-api/src/database.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ export default class Database extends ShellApiClass {
187187
providerOptions,
188188
dbOptions
189189
) as ServiceProviderCursor;
190-
const cursor = new AggregationCursor(this, providerCursor);
190+
const cursor = new AggregationCursor(this._mongo, providerCursor);
191191

192192
if (explain) {
193193
return await cursor.explain('queryPlanner'); // TODO: set default or use optional argument

0 commit comments

Comments
 (0)