summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mongo/db/SConscript1
-rw-r--r--src/mongo/db/fle_crud.cpp9
2 files changed, 5 insertions, 5 deletions
diff --git a/src/mongo/db/SConscript b/src/mongo/db/SConscript
index f579193a566..83a8fa82d5e 100644
--- a/src/mongo/db/SConscript
+++ b/src/mongo/db/SConscript
@@ -920,6 +920,7 @@ env.Library(
'$BUILD_DIR/mongo/executor/task_executor_pool',
'$BUILD_DIR/mongo/s/grid',
'$BUILD_DIR/mongo/s/sharding_router_api',
+ 'dbdirectclient',
'logical_session_id',
],
)
diff --git a/src/mongo/db/fle_crud.cpp b/src/mongo/db/fle_crud.cpp
index 761efbeb843..9846d2165df 100644
--- a/src/mongo/db/fle_crud.cpp
+++ b/src/mongo/db/fle_crud.cpp
@@ -40,6 +40,7 @@
#include "mongo/crypto/encryption_fields_gen.h"
#include "mongo/crypto/fle_crypto.h"
#include "mongo/db/auth/authorization_session.h"
+#include "mongo/db/dbdirectclient.h"
#include "mongo/db/namespace_string.h"
#include "mongo/db/ops/write_ops_gen.h"
#include "mongo/db/ops/write_ops_parsers.h"
@@ -1282,12 +1283,10 @@ uint64_t FLEQueryInterfaceImpl::countDocuments(const NamespaceString& nss) {
CountCommandRequest ccr(nss);
auto opMsgRequest = ccr.serialize(BSONObj());
- auto requestMessage = opMsgRequest.serialize();
+ DBDirectClient directClient(opCtx.get());
+ auto uniqueReply = directClient.runCommand(opMsgRequest);
- auto serviceEntryPoint = opCtx->getServiceContext()->getServiceEntryPoint();
- DbResponse dbResponse = serviceEntryPoint->handleRequest(opCtx.get(), requestMessage).get();
-
- auto reply = rpc::makeReply(&dbResponse.response)->getCommandReply().getOwned();
+ auto reply = uniqueReply->getCommandReply();
auto status = getStatusFromWriteCommandReply(reply);
uassertStatusOK(status);