summaryrefslogtreecommitdiff
path: root/src/mongo/dbtests/mock
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/dbtests/mock')
-rw-r--r--src/mongo/dbtests/mock/mock_dbclient_connection.cpp49
-rw-r--r--src/mongo/dbtests/mock/mock_dbclient_connection.h12
-rw-r--r--src/mongo/dbtests/mock/mock_remote_db_server.cpp14
-rw-r--r--src/mongo/dbtests/mock/mock_remote_db_server.h15
4 files changed, 0 insertions, 90 deletions
diff --git a/src/mongo/dbtests/mock/mock_dbclient_connection.cpp b/src/mongo/dbtests/mock/mock_dbclient_connection.cpp
index f66746b71c0..957888cfa35 100644
--- a/src/mongo/dbtests/mock/mock_dbclient_connection.cpp
+++ b/src/mongo/dbtests/mock/mock_dbclient_connection.cpp
@@ -160,55 +160,6 @@ std::unique_ptr<DBClientCursor> MockDBClientConnection::find(
return nullptr;
}
-std::unique_ptr<mongo::DBClientCursor> MockDBClientConnection::query_DEPRECATED(
- const NamespaceStringOrUUID& nsOrUuid,
- const BSONObj& filter,
- const client_deprecated::Query& querySettings,
- int limit,
- int nToSkip,
- const BSONObj* fieldsToReturn,
- int queryOptions,
- int batchSize,
- boost::optional<BSONObj> readConcernObj) {
- checkConnection();
-
- try {
- mongo::BSONArray result(_remoteServer->query(_remoteServerInstanceID,
- nsOrUuid,
- filter,
- querySettings,
- limit,
- nToSkip,
- fieldsToReturn,
- queryOptions,
- batchSize,
- readConcernObj));
-
- BSONArray resultsInCursor;
-
- // A simple mock implementation of a resumable query, where we skip the first 'n' fields
- // where 'n' is given by the mock resume token.
- auto nToSkip = 0;
- BSONObj querySettingsAsBSON = querySettings.getFullSettingsDeprecated();
- if (querySettingsAsBSON.hasField("$_resumeAfter")) {
- nToSkip = nToSkipFromResumeAfter(querySettingsAsBSON.getField("$_resumeAfter").Obj());
- }
-
- bool provideResumeToken = false;
- if (querySettingsAsBSON.hasField("$_requestResumeToken")) {
- provideResumeToken = true;
- }
-
-
- return bsonArrayToCursor(std::move(result), nToSkip, provideResumeToken, batchSize);
- } catch (const mongo::DBException&) {
- _failed.store(true);
- throw;
- }
-
- return nullptr;
-}
-
mongo::ConnectionString::ConnectionType MockDBClientConnection::type() const {
return mongo::ConnectionString::ConnectionType::kCustom;
}
diff --git a/src/mongo/dbtests/mock/mock_dbclient_connection.h b/src/mongo/dbtests/mock/mock_dbclient_connection.h
index 0baac0ebfba..4b60f2bec4a 100644
--- a/src/mongo/dbtests/mock/mock_dbclient_connection.h
+++ b/src/mongo/dbtests/mock/mock_dbclient_connection.h
@@ -104,7 +104,6 @@ public:
// DBClientBase methods
//
using DBClientBase::find;
- using DBClientBase::query_DEPRECATED;
bool connect(const char* hostName, StringData applicationName, std::string& errmsg);
@@ -125,17 +124,6 @@ public:
const ReadPreferenceSetting& /*unused*/,
ExhaustMode /*unused*/) override;
- std::unique_ptr<mongo::DBClientCursor> query_DEPRECATED(
- const NamespaceStringOrUUID& nsOrUuid,
- const BSONObj& filter = BSONObj{},
- const client_deprecated::Query& querySettings = client_deprecated::Query(),
- int limit = 0,
- int nToSkip = 0,
- const mongo::BSONObj* fieldsToReturn = nullptr,
- int queryOptions = 0,
- int batchSize = 0,
- boost::optional<BSONObj> readConcernObj = boost::none) override;
-
uint64_t getSockCreationMicroSec() const override;
void insert(const std::string& ns,
diff --git a/src/mongo/dbtests/mock/mock_remote_db_server.cpp b/src/mongo/dbtests/mock/mock_remote_db_server.cpp
index b25a4021beb..0b98308d1d2 100644
--- a/src/mongo/dbtests/mock/mock_remote_db_server.cpp
+++ b/src/mongo/dbtests/mock/mock_remote_db_server.cpp
@@ -228,20 +228,6 @@ mongo::BSONArray MockRemoteDBServer::find(MockRemoteDBServer::InstanceID id,
return findImpl(id, findRequest.getNamespaceOrUUID(), findRequest.getProjection());
}
-mongo::BSONArray MockRemoteDBServer::query(MockRemoteDBServer::InstanceID id,
- const NamespaceStringOrUUID& nsOrUuid,
- const BSONObj& filter,
- const client_deprecated::Query& querySettings,
- int limit,
- int nToSkip,
- const BSONObj* fieldsToReturn,
- int queryOptions,
- int batchSize,
- boost::optional<BSONObj> readConcernObj) {
- BSONObj projection = fieldsToReturn ? *fieldsToReturn : BSONObj{};
- return findImpl(id, nsOrUuid, std::move(projection));
-}
-
mongo::ConnectionString::ConnectionType MockRemoteDBServer::type() const {
return mongo::ConnectionString::ConnectionType::kCustom;
}
diff --git a/src/mongo/dbtests/mock/mock_remote_db_server.h b/src/mongo/dbtests/mock/mock_remote_db_server.h
index c20dc851580..034ad8e7ea4 100644
--- a/src/mongo/dbtests/mock/mock_remote_db_server.h
+++ b/src/mongo/dbtests/mock/mock_remote_db_server.h
@@ -32,7 +32,6 @@
#include <string>
#include <vector>
-#include "mongo/client/client_deprecated.h"
#include "mongo/client/connection_string.h"
#include "mongo/db/jsobj.h"
#include "mongo/db/query/find_command_gen.h"
@@ -168,20 +167,6 @@ public:
*/
mongo::BSONArray find(InstanceID id, const FindCommandRequest& findRequest);
- /**
- * Legacy query API: New callers should use 'find()' rather than this method.
- */
- mongo::BSONArray query(InstanceID id,
- const NamespaceStringOrUUID& nsOrUuid,
- const BSONObj& filter,
- const client_deprecated::Query& querySettings,
- int limit = 0,
- int nToSkip = 0,
- const mongo::BSONObj* fieldsToReturn = nullptr,
- int queryOptions = 0,
- int batchSize = 0,
- boost::optional<BSONObj> readConcernObj = boost::none);
-
//
// Getters
//