@@ -76,12 +76,10 @@ export class OpQueryRequest {
76
76
partial : boolean ;
77
77
/** moreToCome is an OP_MSG only concept */
78
78
moreToCome = false ;
79
+ databaseName : string ;
80
+ query : Document ;
79
81
80
- constructor (
81
- public databaseName : string ,
82
- public query : Document ,
83
- options : OpQueryOptions
84
- ) {
82
+ constructor ( databaseName : string , query : Document , options : OpQueryOptions ) {
85
83
// Basic options needed to be passed in
86
84
// TODO(NODE-3483): Replace with MongoCommandError
87
85
const ns = `${ databaseName } .$cmd` ;
@@ -97,7 +95,9 @@ export class OpQueryRequest {
97
95
throw new MongoRuntimeError ( 'Namespace cannot contain a null character' ) ;
98
96
}
99
97
100
- // Basic options
98
+ // Basic optionsa
99
+ this . databaseName = databaseName ;
100
+ this . query = query ;
101
101
this . ns = ns ;
102
102
103
103
// Additional options
@@ -496,17 +496,18 @@ export class OpMsgRequest {
496
496
checksumPresent : boolean ;
497
497
moreToCome : boolean ;
498
498
exhaustAllowed : boolean ;
499
+ databaseName : string ;
500
+ command : Document ;
501
+ options : OpQueryOptions ;
499
502
500
- constructor (
501
- public databaseName : string ,
502
- public command : Document ,
503
- public options : OpQueryOptions
504
- ) {
503
+ constructor ( databaseName : string , command : Document , options : OpQueryOptions ) {
505
504
// Basic options needed to be passed in
506
505
if ( command == null )
507
506
throw new MongoInvalidArgumentError ( 'Query document must be specified for query' ) ;
508
507
509
- // Basic options
508
+ // Basic optionsa
509
+ this . databaseName = databaseName ;
510
+ this . command = command ;
510
511
this . command . $db = databaseName ;
511
512
512
513
// Ensure empty options
@@ -724,16 +725,30 @@ export class OpMsgResponse {
724
725
const MESSAGE_HEADER_SIZE = 16 ;
725
726
const COMPRESSION_DETAILS_SIZE = 9 ; // originalOpcode + uncompressedSize, compressorID
726
727
728
+ /**
729
+ * @internal
730
+ */
731
+ export interface OpCompressesRequestOptions {
732
+ zlibCompressionLevel : number ;
733
+ agreedCompressor : CompressorName ;
734
+ }
735
+
727
736
/**
728
737
* @internal
729
738
*
730
739
* An OP_COMPRESSED request wraps either an OP_QUERY or OP_MSG message.
731
740
*/
732
741
export 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
+ }
737
752
738
753
// Return whether a command contains an uncompressible command term
739
754
// Will return true if command contains no uncompressible command terms
0 commit comments