From ee93834b08ca7556b30125cce8399b11b35d9dd8 Mon Sep 17 00:00:00 2001 From: Aditi Khare Date: Fri, 13 Sep 2024 15:59:46 -0400 Subject: [PATCH] add moreToCome back on the request --- src/cmap/commands.ts | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/cmap/commands.ts b/src/cmap/commands.ts index a613447a06f..1cc074b3b1c 100644 --- a/src/cmap/commands.ts +++ b/src/cmap/commands.ts @@ -50,6 +50,7 @@ export interface OpQueryOptions extends CommandOptions { secondaryOk?: boolean; requestId?: number; + moreToCome?: boolean; exhaustAllowed?: boolean; } @@ -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; } @@ -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; }