* Builds a find operation for an update/updateOne/delete/deleteOne/replaceOne. * Returns a builder object used to complete the definition of the operation. * * @example * ```ts * const bulkOp = collection.initializeOrderedBulkOp(); * * // Add an updateOne to the bulkOp * bulk
(selector: Document)
| 1021 | * ``` |
| 1022 | */ |
| 1023 | find(selector: Document): FindOperators { |
| 1024 | if (!selector) { |
| 1025 | throw new MongoInvalidArgumentError(class="st">'Bulk find operation must specify a selector'); |
| 1026 | } |
| 1027 | |
| 1028 | class="cm">// Save a current selector |
| 1029 | this.s.currentOp = { |
| 1030 | selector: selector |
| 1031 | }; |
| 1032 | |
| 1033 | return new FindOperators(this); |
| 1034 | } |
| 1035 | |
| 1036 | /** Specifies a raw operation to perform in the bulk write. */ |
| 1037 | raw(op: AnyBulkWriteOperation): this { |