diff options
author | David Storch <david.storch@mongodb.com> | 2021-12-21 11:15:42 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-12-21 11:55:50 +0000 |
commit | 19080405d9c7d08b54e70228a92d237223f2885c (patch) | |
tree | 73748cedfa62252c21968fdd4d0290972bbf3641 /src/mongo/db/dbdirectclient.cpp | |
parent | 58ca93e30a6436f47a8e8eaa3ddc831e376965dc (diff) | |
download | mongo-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/db/dbdirectclient.cpp')
-rw-r--r-- | src/mongo/db/dbdirectclient.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/src/mongo/db/dbdirectclient.cpp b/src/mongo/db/dbdirectclient.cpp index 580104f1c48..479557afc7e 100644 --- a/src/mongo/db/dbdirectclient.cpp +++ b/src/mongo/db/dbdirectclient.cpp @@ -145,18 +145,11 @@ void DBDirectClient::say(Message& toSend, bool isRetry, string* actualServer) { invariant(dbResponse.response.empty()); } -unique_ptr<DBClientCursor> DBDirectClient::query(const NamespaceStringOrUUID& nsOrUuid, - const BSONObj& filter, - const Query& querySettings, - int limit, - int nToSkip, - const BSONObj* fieldsToReturn, - int queryOptions, - int batchSize, - boost::optional<BSONObj> readConcernObj) { - invariant(!readConcernObj, "passing readConcern to DBDirectClient functions is not supported"); - return DBClientBase::query( - nsOrUuid, filter, querySettings, limit, nToSkip, fieldsToReturn, queryOptions, batchSize); +std::unique_ptr<DBClientCursor> DBDirectClient::find(FindCommandRequest findRequest, + const ReadPreferenceSetting& readPref) { + invariant(!findRequest.getReadConcern(), + "passing readConcern to DBDirectClient::find() is not supported"); + return DBClientBase::find(std::move(findRequest), readPref); } write_ops::FindAndModifyCommandReply DBDirectClient::findAndModify( |