Skip to content

Commit ff9fd26

Browse files
class variables consistency
1 parent 36c16dc commit ff9fd26

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/cmap/commands.ts

+6-7
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export interface OpQueryOptions extends CommandOptions {
5454
/** @internal */
5555
export class Query {
5656
ns: string;
57-
query: Document;
5857
numberToSkip: number;
5958
numberToReturn: number;
6059
returnFieldSelector?: Document;
@@ -74,7 +73,7 @@ export class Query {
7473
partial: boolean;
7574
documentsReturnedIn?: string;
7675

77-
constructor(public databaseName: string, query: Document, options: OpQueryOptions) {
76+
constructor(public databaseName: string, public query: Document, options: OpQueryOptions) {
7877
// Basic options needed to be passed in
7978
// TODO(NODE-3483): Replace with MongoCommandError
8079
const ns = `${databaseName}.$cmd`;
@@ -92,7 +91,6 @@ export class Query {
9291

9392
// Basic options
9493
this.ns = ns;
95-
this.query = query;
9694

9795
// Additional options
9896
this.numberToSkip = options.numberToSkip || 0;
@@ -475,8 +473,6 @@ export interface OpMsgOptions {
475473

476474
/** @internal */
477475
export class Msg {
478-
command: Document;
479-
options: OpQueryOptions;
480476
requestId: number;
481477
serializeFunctions: boolean;
482478
ignoreUndefined: boolean;
@@ -486,13 +482,16 @@ export class Msg {
486482
moreToCome: boolean;
487483
exhaustAllowed: boolean;
488484

489-
constructor(public databaseName: string, command: Document, options: OpQueryOptions) {
485+
constructor(
486+
public databaseName: string,
487+
public command: Document,
488+
public options: OpQueryOptions
489+
) {
490490
// Basic options needed to be passed in
491491
if (command == null)
492492
throw new MongoInvalidArgumentError('Query document must be specified for query');
493493

494494
// Basic options
495-
this.command = command;
496495
this.command.$db = databaseName;
497496

498497
if (options.readPreference && options.readPreference.mode !== ReadPreference.PRIMARY) {

0 commit comments

Comments
 (0)