@@ -76,12 +76,10 @@ export class OpQueryRequest {
7676 partial : boolean ;
7777 /** moreToCome is an OP_MSG only concept */
7878 moreToCome = false ;
79+ databaseName : string ;
80+ query : Document ;
7981
80- constructor (
81- public databaseName : string ,
82- public query : Document ,
83- options : OpQueryOptions
84- ) {
82+ constructor ( databaseName : string , query : Document , options : OpQueryOptions ) {
8583 // Basic options needed to be passed in
8684 // TODO(NODE-3483): Replace with MongoCommandError
8785 const ns = `${ databaseName } .$cmd` ;
@@ -97,7 +95,9 @@ export class OpQueryRequest {
9795 throw new MongoRuntimeError ( 'Namespace cannot contain a null character' ) ;
9896 }
9997
100- // Basic options
98+ // Basic optionsa
99+ this . databaseName = databaseName ;
100+ this . query = query ;
101101 this . ns = ns ;
102102
103103 // Additional options
@@ -496,17 +496,18 @@ export class OpMsgRequest {
496496 checksumPresent : boolean ;
497497 moreToCome : boolean ;
498498 exhaustAllowed : boolean ;
499+ databaseName : string ;
500+ command : Document ;
501+ options : OpQueryOptions ;
499502
500- constructor (
501- public databaseName : string ,
502- public command : Document ,
503- public options : OpQueryOptions
504- ) {
503+ constructor ( databaseName : string , command : Document , options : OpQueryOptions ) {
505504 // Basic options needed to be passed in
506505 if ( command == null )
507506 throw new MongoInvalidArgumentError ( 'Query document must be specified for query' ) ;
508507
509- // Basic options
508+ // Basic optionsa
509+ this . databaseName = databaseName ;
510+ this . command = command ;
510511 this . command . $db = databaseName ;
511512
512513 // Ensure empty options
@@ -724,16 +725,30 @@ export class OpMsgResponse {
724725const MESSAGE_HEADER_SIZE = 16 ;
725726const COMPRESSION_DETAILS_SIZE = 9 ; // originalOpcode + uncompressedSize, compressorID
726727
728+ /**
729+ * @internal
730+ */
731+ export interface OpCompressesRequestOptions {
732+ zlibCompressionLevel : number ;
733+ agreedCompressor : CompressorName ;
734+ }
735+
727736/**
728737 * @internal
729738 *
730739 * An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message.
731740 */
732741export class OpCompressedRequest {
733- constructor (
734- private command : WriteProtocolMessageType ,
735- private options : { zlibCompressionLevel : number ; agreedCompressor : CompressorName }
736- ) { }
742+ private command : WriteProtocolMessageType ;
743+ private options : OpCompressesRequestOptions ;
744+
745+ constructor ( command : WriteProtocolMessageType , options : OpCompressesRequestOptions ) {
746+ this . command = command ;
747+ this . options = {
748+ zlibCompressionLevel : options . zlibCompressionLevel ,
749+ agreedCompressor : options . agreedCompressor
750+ } ;
751+ }
737752
738753 // Return whether a command contains an uncompressible command term
739754 // Will return true if command contains no uncompressible command terms
0 commit comments