Skip to content

Commit 0dd646a

Browse files
committed
fix(mongo): ensure correct cursor id as bigint, ensure batchSize is used
1 parent f3c9683 commit 0dd646a

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • packages/mongo/src/client/command

packages/mongo/src/client/command/find.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export class FindCommand<T> extends Command<T[]> {
5151
filter: this.filter,
5252
limit: this.limit,
5353
skip: this.skip,
54-
batchSize: config.options.batchSize,
54+
batchSize: this.options.batchSize || config.options.batchSize,
5555
};
5656

5757
const allowDiskUse = config.options.allowDiskUse ?? config.options.allowDiskUse;
@@ -86,7 +86,7 @@ export class FindCommand<T> extends Command<T[]> {
8686
if (this.projection) {
8787
interface SpecialisedResponse extends BaseResponse {
8888
cursor: {
89-
id: number;
89+
id: bigint;
9090
firstBatch?: Partial<InlineRuntimeType<typeof type>>[];
9191
nextBatch?: Partial<InlineRuntimeType<typeof type>>[];
9292
};
@@ -96,7 +96,7 @@ export class FindCommand<T> extends Command<T[]> {
9696
} else {
9797
interface SpecialisedResponse extends BaseResponse {
9898
cursor: {
99-
id: number;
99+
id: bigint;
100100
firstBatch?: InlineRuntimeType<typeof type>[];
101101
nextBatch?: InlineRuntimeType<typeof type>[];
102102
};
@@ -111,7 +111,7 @@ export class FindCommand<T> extends Command<T[]> {
111111
if (this.projection) {
112112
interface SpecialisedResponse extends BaseResponse {
113113
cursor: {
114-
id: number;
114+
id: bigint;
115115
firstBatch?: Partial<resultSchema>[];
116116
nextBatch?: Partial<resultSchema>[];
117117
};
@@ -121,7 +121,7 @@ export class FindCommand<T> extends Command<T[]> {
121121
} else {
122122
interface SpecialisedResponse extends BaseResponse {
123123
cursor: {
124-
id: number;
124+
id: bigint;
125125
firstBatch?: resultSchema[];
126126
nextBatch?: resultSchema[];
127127
};

0 commit comments

Comments
 (0)