Skip to content

Commit 819517e

Browse files
remove shim
1 parent 62ee30c commit 819517e

File tree

1 file changed

+1
-37
lines changed

1 file changed

+1
-37
lines changed

src/bulk/common.ts

Lines changed: 1 addition & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,9 @@ import type { CollationOptions, CommandOperationOptions } from '../operations/co
1414
import { DeleteOperation, type DeleteStatement, makeDeleteStatement } from '../operations/delete';
1515
import { executeOperation } from '../operations/execute_operation';
1616
import { InsertOperation } from '../operations/insert';
17-
import { AbstractOperation, type Hint } from '../operations/operation';
17+
import { type Hint } from '../operations/operation';
1818
import { makeUpdateStatement, UpdateOperation, type UpdateStatement } from '../operations/update';
19-
import type { Server } from '../sdam/server';
2019
import type { Topology } from '../sdam/topology';
21-
import type { ClientSession } from '../sessions';
2220
import { type Sort } from '../sort';
2321
import { TimeoutContext } from '../timeout';
2422
import {
@@ -854,40 +852,6 @@ export interface BulkWriteOptions extends CommandOperationOptions {
854852
timeoutContext?: TimeoutContext;
855853
}
856854

857-
/**
858-
* TODO(NODE-4063)
859-
* BulkWrites merge complexity is implemented in executeCommands
860-
* This provides a vehicle to treat bulkOperations like any other operation (hence "shim")
861-
* We would like this logic to simply live inside the BulkWriteOperation class
862-
* @internal
863-
*/
864-
export class BulkWriteShimOperation extends AbstractOperation {
865-
bulkOperation: BulkOperationBase;
866-
constructor(bulkOperation: BulkOperationBase, options: BulkWriteOptions) {
867-
super(options);
868-
this.bulkOperation = bulkOperation;
869-
}
870-
871-
get commandName(): string {
872-
return 'bulkWrite' as const;
873-
}
874-
875-
async execute(
876-
_server: Server,
877-
session: ClientSession | undefined,
878-
timeoutContext: TimeoutContext
879-
): Promise<any> {
880-
if (this.options.session == null) {
881-
// An implicit session could have been created by 'executeOperation'
882-
// So if we stick it on finalOptions here, each bulk operation
883-
// will use this same session, it'll be passed in the same way
884-
// an explicit session would be
885-
this.options.session = session;
886-
}
887-
return await executeCommands(this.bulkOperation, { ...this.options, timeoutContext });
888-
}
889-
}
890-
891855
/** @public */
892856
export abstract class BulkOperationBase {
893857
isOrdered: boolean;

0 commit comments

Comments
 (0)