summaryrefslogtreecommitdiff
path: root/src/mongo/client/dbclient_connection.cpp
diff options
context:
space:
mode:
authorDavid Storch <david.storch@mongodb.com>2021-12-21 11:15:42 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-12-21 11:55:50 +0000
commit19080405d9c7d08b54e70228a92d237223f2885c (patch)
tree73748cedfa62252c21968fdd4d0290972bbf3641 /src/mongo/client/dbclient_connection.cpp
parent58ca93e30a6436f47a8e8eaa3ddc831e376965dc (diff)
downloadmongo-19080405d9c7d08b54e70228a92d237223f2885c.tar.gz
SERVER-61385 Migrate callers of 'DBClientBase::query()' legacy API to the modern 'find()' API
There are a handful of remaining callers of the legacy API, either using the exhaust option or which are involved in a code path which still relies on the OP_QUERY-inspired BSON format. These should be cleaned up as follow-up work.
Diffstat (limited to 'src/mongo/client/dbclient_connection.cpp')
-rw-r--r--src/mongo/client/dbclient_connection.cpp51
1 files changed, 26 insertions, 25 deletions
diff --git a/src/mongo/client/dbclient_connection.cpp b/src/mongo/client/dbclient_connection.cpp
index 760b060aa57..3eab2b4fab6 100644
--- a/src/mongo/client/dbclient_connection.cpp
+++ b/src/mongo/client/dbclient_connection.cpp
@@ -617,38 +617,39 @@ uint64_t DBClientConnection::getSockCreationMicroSec() const {
}
}
-unsigned long long DBClientConnection::query(std::function<void(DBClientCursorBatchIterator&)> f,
- const NamespaceStringOrUUID& nsOrUuid,
- const BSONObj& filter,
- const Query& querySettings,
- const BSONObj* fieldsToReturn,
- int queryOptions,
- int batchSize,
- boost::optional<BSONObj> readConcernObj) {
+unsigned long long DBClientConnection::query_DEPRECATED(
+ std::function<void(DBClientCursorBatchIterator&)> f,
+ const NamespaceStringOrUUID& nsOrUuid,
+ const BSONObj& filter,
+ const Query& querySettings,
+ const BSONObj* fieldsToReturn,
+ int queryOptions,
+ int batchSize,
+ boost::optional<BSONObj> readConcernObj) {
if (!(queryOptions & QueryOption_Exhaust)) {
- return DBClientBase::query(f,
- nsOrUuid,
- filter,
- querySettings,
- fieldsToReturn,
- queryOptions,
- batchSize,
- readConcernObj);
+ return DBClientBase::query_DEPRECATED(f,
+ nsOrUuid,
+ filter,
+ querySettings,
+ fieldsToReturn,
+ queryOptions,
+ batchSize,
+ readConcernObj);
}
// mask options
queryOptions &=
(int)(QueryOption_NoCursorTimeout | QueryOption_SecondaryOk | QueryOption_Exhaust);
- unique_ptr<DBClientCursor> c(this->query(nsOrUuid,
- filter,
- querySettings,
- 0,
- 0,
- fieldsToReturn,
- queryOptions,
- batchSize,
- readConcernObj));
+ unique_ptr<DBClientCursor> c(this->query_DEPRECATED(nsOrUuid,
+ filter,
+ querySettings,
+ 0,
+ 0,
+ fieldsToReturn,
+ queryOptions,
+ batchSize,
+ readConcernObj));
// Note that this->query will throw for network errors, so it is OK to return a numeric
// error code here.
uassert(13386, "socket error for mapping query", c.get());