diff --git a/src/mongo/db/query/allowed_contexts.cpp b/src/mongo/db/query/allowed_contexts.cpp index cce78af0a3b95..141603fd6f4db 100644 --- a/src/mongo/db/query/allowed_contexts.cpp +++ b/src/mongo/db/query/allowed_contexts.cpp @@ -107,7 +107,7 @@ void assertAllowedInternalIfRequired(const OperationContext* opCtx, const auto isInternal = isInternalClient(opCtx->getClient()); uassert(5491300, - str::stream() << operatorName << "' is not allowed in user requests", + str::stream() << operatorName << " is not allowed in user requests", !(allowedWithClientType == AllowedWithClientType::kInternal && !isInternal)); } } // namespace mongo