Skip to content

Commit b3351ae

Browse files
committed
chore: turn back on cursorResponse
1 parent d132dd7 commit b3351ae

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/cursor/find_cursor.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ export class FindCursor<TSchema = any> extends AbstractCursor<TSchema> {
117117
}
118118
}
119119

120-
const response = await super.getMore(batchSize, false);
120+
const response = await super.getMore(batchSize, this.client.autoEncrypter ? false : true);
121121
// TODO: wrap this in some logic to prevent it from happening if we don't need this support
122122
if (CursorResponse.is(response)) {
123123
this[kNumReturned] = this[kNumReturned] + response.batchSize;

src/operations/find.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { Document } from '../bson';
2+
import { CursorResponse } from '../cmap/wire_protocol/responses';
23
import { MongoInvalidArgumentError } from '../error';
34
import { ReadConcern } from '../read_concern';
45
import type { Server } from '../sdam/server';
@@ -114,7 +115,7 @@ export class FindOperation extends CommandOperation<Document> {
114115
documentsReturnedIn: 'firstBatch',
115116
session
116117
},
117-
undefined
118+
this.explain ? undefined : CursorResponse
118119
);
119120
}
120121
}

0 commit comments

Comments
 (0)