diff --git a/src/mongo/s/commands/query_cmd/cluster_find_and_modify_cmd.cpp b/src/mongo/s/commands/query_cmd/cluster_find_and_modify_cmd.cpp index ad4690d1de2..7d127c1bed6 100644 --- a/src/mongo/s/commands/query_cmd/cluster_find_and_modify_cmd.cpp +++ b/src/mongo/s/commands/query_cmd/cluster_find_and_modify_cmd.cpp @@ -812,43 +812,6 @@ bool FindAndModifyCmd::run(OperationContext* opCtx, // Collect metrics. _updateMetrics->collectMetrics(originalCmdObj); - if (unified_write_executor::isEnabled(opCtx)) { - auto cmdObjForShard = CommandHelpers::filterCommandRequestForPassthrough(originalCmdObj); - - // Evaluate let parameters once before forwarding to the shards for non-deterministic - // operators like $rand. - cmdObjForShard = expandLetParams(opCtx, originalNss, cmdObjForShard); - - // Manually appending the required "$db" field name so that we can pass the parsed command - // request to further processing. - { - BSONObjBuilder bob(cmdObjForShard); - bob.append(write_ops::FindAndModifyCommandRequest::kDbNameFieldName, - DatabaseNameUtil::serialize(originalNss.dbName(), SerializationContext{})); - cmdObjForShard = bob.obj(); - } - - auto request = write_ops::FindAndModifyCommandRequest::parse( - cmdObjForShard, IDLParserContext("ClusterFindAndModify")); - request.setNamespace(originalNss); - - auto response = unified_write_executor::findAndModify(opCtx, request, originalCmdObj); - if (response.swReply.isOK()) { - auto& reply = response.swReply.getValue(); - if (response.wce) { - reply.setWriteConcernError(response.wce->toBSON()); - } - reply.serialize(&result); - } else { - if (response.wce && !result.hasField("writeConcernError")) { - result.append("writeConcernError", response.wce->toBSON()); - } - uassertStatusOK(response.swReply.getStatus()); - } - - return true; - } - if (processFLEFindAndModify(opCtx, originalCmdObj, result) == FLEBatchResult::kProcessed) { return true; } diff --git a/src/mongo/s/write_ops/unified_write_executor/unified_write_executor.cpp b/src/mongo/s/write_ops/unified_write_executor/unified_write_executor.cpp index 7944f8018dc..7a130e7c0d6 100644 --- a/src/mongo/s/write_ops/unified_write_executor/unified_write_executor.cpp +++ b/src/mongo/s/write_ops/unified_write_executor/unified_write_executor.cpp @@ -127,6 +127,8 @@ BulkWriteCommandReply bulkWrite(OperationContext* opCtx, executeWriteCommand(opCtx, WriteCommandRef{request}, originalCommand)); } +// TODO(SERVER-115515) Clean up FAM code in UWE (here and across files in +// mongo/s/write_ops/unified_write_executor/*). FindAndModifyCommandResponse findAndModify( OperationContext* opCtx, const write_ops::FindAndModifyCommandRequest& originalRequest,