-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: all write commands now inherit from CommandOperation (#2665)
This patch moves the command construction for write operations from the wire protocol layer to the operation layer. Specifically, the insert/update/delete operations, which are also shared by the bulk implementation, are now the primary sites for write command construction. This has a few implications, primarily that you can no longer "write" with a `Server` instance, you can only execute a write operation against it. NODE-2953
- Loading branch information
Showing
42 changed files
with
679 additions
and
1,123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,4 @@ | ||
import type { Server } from '../../sdam/server'; | ||
|
||
export { killCursors } from './kill_cursors'; | ||
export { getMore } from './get_more'; | ||
export { query } from './query'; | ||
export { command } from './command'; | ||
|
||
import { writeCommand, WriteCommandOptions } from './write_command'; | ||
import type { Document } from '../../bson'; | ||
import type { Callback } from '../../utils'; | ||
|
||
export { writeCommand }; | ||
|
||
export function insert( | ||
server: Server, | ||
ns: string, | ||
ops: Document[], | ||
options: WriteCommandOptions, | ||
callback: Callback | ||
): void { | ||
writeCommand(server, 'insert', 'documents', ns, ops, options, callback); | ||
} | ||
|
||
export function update( | ||
server: Server, | ||
ns: string, | ||
ops: Document[], | ||
options: WriteCommandOptions, | ||
callback: Callback | ||
): void { | ||
writeCommand(server, 'update', 'updates', ns, ops, options, callback); | ||
} | ||
|
||
export function remove( | ||
server: Server, | ||
ns: string, | ||
ops: Document[], | ||
options: WriteCommandOptions, | ||
callback: Callback | ||
): void { | ||
writeCommand(server, 'delete', 'deletes', ns, ops, options, callback); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.