Add a replace one operation to the bulk operation
(replacement: Document)
| 715 | |
| 716 | /** Add a replace one operation to the bulk operation */ |
| 717 | replaceOne(replacement: Document): BulkOperationBase { |
| 718 | if (hasAtomicOperators(replacement)) { |
| 719 | throw new MongoInvalidArgumentError(class="st">'Replacement document must not use atomic operators'); |
| 720 | } |
| 721 | |
| 722 | const currentOp = buildCurrentOp(this.bulkOperation); |
| 723 | return this.bulkOperation.addToOperationsList( |
| 724 | BatchType.UPDATE, |
| 725 | makeUpdateStatement(currentOp.selector, replacement, { ...currentOp, multi: false }) |
| 726 | ); |
| 727 | } |
| 728 | |
| 729 | /** Add a delete one operation to the bulk operation */ |
| 730 | deleteOne(): BulkOperationBase { |
nothing calls this directly
no test coverage detected