Skip to content

Commit

Permalink
add moreToCome back on the request
Browse files Browse the repository at this point in the history
  • Loading branch information
aditi-khare-mongoDB committed Sep 13, 2024
1 parent 6422402 commit ee93834
Showing 1 changed file with 17 additions and 7 deletions.
24 changes: 17 additions & 7 deletions src/cmap/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ export interface OpQueryOptions extends CommandOptions {
secondaryOk?: boolean;

requestId?: number;
moreToCome?: boolean;
exhaustAllowed?: boolean;
}

Expand Down Expand Up @@ -408,12 +409,21 @@ const OPTS_EXHAUST_ALLOWED = 1 << 16;

/** @internal */
export interface OpMsgOptions {
requestId: number;
serializeFunctions: boolean;
ignoreUndefined: boolean;
checkKeys: boolean;
maxBsonSize: number;
exhaustAllowed: boolean;
socketTimeoutMS?: number;
session?: ClientSession;
numberToSkip?: number;
numberToReturn?: number;
returnFieldSelector?: Document;
pre32Limit?: number;
serializeFunctions?: boolean;
ignoreUndefined?: boolean;
maxBsonSize?: number;
checkKeys?: boolean;
secondaryOk?: boolean;

requestId?: number;
moreToCome?: boolean;
exhaustAllowed?: boolean;
readPreference: ReadPreference;
}

Expand Down Expand Up @@ -465,7 +475,7 @@ export class OpMsgRequest {

// flags
this.checksumPresent = false;
this.moreToCome = command.writeConcern?.w === 0 || false;
this.moreToCome = options.moreToCome || command.writeConcern?.w === 0 || false;
this.exhaustAllowed =
typeof options.exhaustAllowed === 'boolean' ? options.exhaustAllowed : false;
}
Expand Down

0 comments on commit ee93834

Please sign in to comment.