Skip to content

Commit 9bee42b

Browse files
mtrussottoevergreen
authored andcommitted
SERVER-44021 Make type of "count" command in DBClient_Base match server.
1 parent 08d2e61 commit 9bee42b

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

src/mongo/client/dbclient_base.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ bool DBClientBase::runPseudoCommand(StringData db,
319319
return success;
320320
}
321321

322-
unsigned long long DBClientBase::count(
322+
long long DBClientBase::count(
323323
const NamespaceStringOrUUID nsOrUuid, const BSONObj& query, int options, int limit, int skip) {
324324
auto dbName = (nsOrUuid.uuid() ? nsOrUuid.dbname() : (*nsOrUuid.nss()).db().toString());
325325
BSONObj cmd = _countCmd(nsOrUuid, query, options, limit, skip);

src/mongo/client/dbclient_base.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -351,11 +351,11 @@ class DBClientBase : public DBClientQueryInterface {
351351
/** count number of objects in collection ns that match the query criteria specified
352352
throws UserAssertion if database returns an error
353353
*/
354-
virtual unsigned long long count(NamespaceStringOrUUID nsOrUuid,
355-
const BSONObj& query = BSONObj(),
356-
int options = 0,
357-
int limit = 0,
358-
int skip = 0);
354+
virtual long long count(NamespaceStringOrUUID nsOrUuid,
355+
const BSONObj& query = BSONObj(),
356+
int options = 0,
357+
int limit = 0,
358+
int skip = 0);
359359

360360
static std::string createPasswordDigest(const std::string& username,
361361
const std::string& clearTextPassword);

src/mongo/db/dbdirectclient.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ unique_ptr<DBClientCursor> DBDirectClient::query(const NamespaceStringOrUUID& ns
172172
nsOrUuid, query, nToReturn, nToSkip, fieldsToReturn, queryOptions, batchSize);
173173
}
174174

175-
unsigned long long DBDirectClient::count(
175+
long long DBDirectClient::count(
176176
const NamespaceStringOrUUID nsOrUuid, const BSONObj& query, int options, int limit, int skip) {
177177
DirectClientScope directClientScope(_opCtx);
178178
BSONObj cmdObj = _countCmd(nsOrUuid, query, options, limit, skip);

src/mongo/db/dbdirectclient.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ class DBDirectClient : public DBClientBase {
8181

8282
virtual void say(Message& toSend, bool isRetry = false, std::string* actualServer = nullptr);
8383

84-
virtual unsigned long long count(const NamespaceStringOrUUID nsOrUuid,
85-
const BSONObj& query = BSONObj(),
86-
int options = 0,
87-
int limit = 0,
88-
int skip = 0);
84+
virtual long long count(const NamespaceStringOrUUID nsOrUuid,
85+
const BSONObj& query = BSONObj(),
86+
int options = 0,
87+
int limit = 0,
88+
int skip = 0);
8989

9090
virtual ConnectionString::ConnectionType type() const;
9191

0 commit comments

Comments
 (0)