@@ -5,9 +5,7 @@ import { MongoDBResponse } from '../cmap/wire_protocol/responses';
5
5
import type { Collection } from '../collection' ;
6
6
import { MongoServerError } from '../error' ;
7
7
import type { InferIdType } from '../mongo_types' ;
8
- import type { Server } from '../sdam/server' ;
9
8
import type { ClientSession } from '../sessions' ;
10
- import { type TimeoutContext } from '../timeout' ;
11
9
import { maybeAddIdToDocuments , type MongoDBNamespace } from '../utils' ;
12
10
import { type CommandOperationOptions , ModernizedCommandOperation } from './command' ;
13
11
import { Aspect , defineAspects } from './operation' ;
@@ -73,24 +71,6 @@ export class InsertOneOperation extends InsertOperation {
73
71
super ( collection . s . namespace , [ maybeAddIdToDocuments ( collection , doc , options ) ] , options ) ;
74
72
}
75
73
76
- override async execute (
77
- server : Server ,
78
- session : ClientSession | undefined ,
79
- timeoutContext : TimeoutContext
80
- ) : Promise < InsertOneResult > {
81
- const res = await super . execute ( server , session , timeoutContext ) ;
82
- if ( res . code ) throw new MongoServerError ( res ) ;
83
- if ( res . writeErrors ) {
84
- // This should be a WriteError but we can't change it now because of error hierarchy
85
- throw new MongoServerError ( res . writeErrors [ 0 ] ) ;
86
- }
87
-
88
- return {
89
- acknowledged : this . writeConcern ?. w !== 0 ,
90
- insertedId : this . documents [ 0 ] . _id
91
- } ;
92
- }
93
-
94
74
override handleOk ( response : InstanceType < typeof this . SERVER_COMMAND_RESPONSE_TYPE > ) : Document {
95
75
const res = super . handleOk ( response ) ;
96
76
if ( res . code ) throw new MongoServerError ( res ) ;
0 commit comments