Add a single update operation to the bulk operation
(updateDocument: Document | Document[])
| 702 | |
| 703 | /** Add a single update operation to the bulk operation */ |
| 704 | updateOne(updateDocument: Document | Document[]): BulkOperationBase { |
| 705 | if (!hasAtomicOperators(updateDocument, this.bulkOperation.bsonOptions)) { |
| 706 | throw new MongoInvalidArgumentError('Update document requires atomic operators'); |
| 707 | } |
| 708 | |
| 709 | const currentOp = buildCurrentOp(this.bulkOperation); |
| 710 | return this.bulkOperation.addToOperationsList( |
| 711 | BatchType.UPDATE, |
| 712 | makeUpdateStatement(currentOp.selector, updateDocument, { ...currentOp, multi: false }) |
| 713 | ); |
| 714 | } |
| 715 | |
| 716 | /** Add a replace one operation to the bulk operation */ |
| 717 | replaceOne(replacement: Document): BulkOperationBase { |
no test coverage detected