summaryrefslogtreecommitdiff
path: root/src/mongo/s/sharding_router_test_fixture.cpp
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2020-11-02 18:09:28 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-07 20:04:53 +0000
commitc8ddb496f147e5a977eb668247b81da313d06e1d (patch)
tree34ba0cc443ec6294c5585d0951d5430cc69349e2 /src/mongo/s/sharding_router_test_fixture.cpp
parentd0cfd1d0c0fcfd75525a8d8f3a050876bc9d1e40 (diff)
downloadmongo-c8ddb496f147e5a977eb668247b81da313d06e1d.tar.gz
SERVER-51619 Convert find command input to IDL
Diffstat (limited to 'src/mongo/s/sharding_router_test_fixture.cpp')
-rw-r--r--src/mongo/s/sharding_router_test_fixture.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/mongo/s/sharding_router_test_fixture.cpp b/src/mongo/s/sharding_router_test_fixture.cpp
index 04c652dcd8d..670620bf52e 100644
--- a/src/mongo/s/sharding_router_test_fixture.cpp
+++ b/src/mongo/s/sharding_router_test_fixture.cpp
@@ -255,10 +255,9 @@ void ShardingTestFixture::expectGetShards(const std::vector<ShardType>& shards)
const NamespaceString nss(request.dbname, request.cmdObj.firstElement().String());
ASSERT_EQ(nss, ShardType::ConfigNS);
- auto queryResult = QueryRequest::makeFromFindCommand(nss, request.cmdObj, false);
- ASSERT_OK(queryResult.getStatus());
-
- const auto& query = queryResult.getValue();
+ // If there is no '$db', append it.
+ auto cmd = OpMsgRequest::fromDBAndBody(nss.db(), request.cmdObj).body;
+ auto query = QueryRequest::makeFromFindCommand(cmd, false, nss);
ASSERT_EQ(query->nss(), ShardType::ConfigNS);
ASSERT_BSONOBJ_EQ(query->getFilter(), BSONObj());