@@ -4,7 +4,7 @@ import { MONGODB_ERROR_CODES, MongoServerError } from '../error';
4
4
import type { Server } from '../sdam/server' ;
5
5
import type { ClientSession } from '../sessions' ;
6
6
import type { Callback } from '../utils' ;
7
- import { CommandOperation , type CommandOperationOptions } from './command' ;
7
+ import { CommandCallbackOperation , type CommandOperationOptions } from './command' ;
8
8
import { Aspect , defineAspects } from './operation' ;
9
9
10
10
/** @public */
@@ -14,7 +14,7 @@ export interface DropCollectionOptions extends CommandOperationOptions {
14
14
}
15
15
16
16
/** @internal */
17
- export class DropCollectionOperation extends CommandOperation < boolean > {
17
+ export class DropCollectionOperation extends CommandCallbackOperation < boolean > {
18
18
override options : DropCollectionOptions ;
19
19
db : Db ;
20
20
name : string ;
@@ -83,7 +83,7 @@ export class DropCollectionOperation extends CommandOperation<boolean> {
83
83
session : ClientSession | undefined
84
84
) : Promise < boolean > {
85
85
return new Promise < boolean > ( ( resolve , reject ) => {
86
- super . executeCommand ( server , session , { drop : this . name } , ( err , result ) => {
86
+ super . executeCommandCallback ( server , session , { drop : this . name } , ( err , result ) => {
87
87
if ( err ) return reject ( err ) ;
88
88
resolve ( ! ! result . ok ) ;
89
89
} ) ;
@@ -95,7 +95,7 @@ export class DropCollectionOperation extends CommandOperation<boolean> {
95
95
export type DropDatabaseOptions = CommandOperationOptions ;
96
96
97
97
/** @internal */
98
- export class DropDatabaseOperation extends CommandOperation < boolean > {
98
+ export class DropDatabaseOperation extends CommandCallbackOperation < boolean > {
99
99
override options : DropDatabaseOptions ;
100
100
101
101
constructor ( db : Db , options : DropDatabaseOptions ) {
@@ -107,7 +107,7 @@ export class DropDatabaseOperation extends CommandOperation<boolean> {
107
107
session : ClientSession | undefined ,
108
108
callback : Callback < boolean >
109
109
) : void {
110
- super . executeCommand ( server , session , { dropDatabase : 1 } , ( err , result ) => {
110
+ super . executeCommandCallback ( server , session , { dropDatabase : 1 } , ( err , result ) => {
111
111
if ( err ) return callback ( err ) ;
112
112
if ( result . ok ) return callback ( undefined , true ) ;
113
113
callback ( undefined , false ) ;
0 commit comments