diff options
Diffstat (limited to 'src/mongo/dbtests/querytests.cpp')
-rw-r--r-- | src/mongo/dbtests/querytests.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mongo/dbtests/querytests.cpp b/src/mongo/dbtests/querytests.cpp index f4e28010795..89b52a3f172 100644 --- a/src/mongo/dbtests/querytests.cpp +++ b/src/mongo/dbtests/querytests.cpp @@ -768,22 +768,22 @@ public: insert(ns, BSON("ts" << Timestamp(1000, 0))); insert(ns, BSON("ts" << Timestamp(1000, 1))); insert(ns, BSON("ts" << Timestamp(1000, 2))); - unique_ptr<DBClientCursor> c = _client.query( - NamespaceString(ns), - QUERY("ts" << GT << Timestamp(1000, 1)).hint(BSON("$natural" << 1)).explain(), - 0, - 0, - nullptr); - ASSERT(c->more()); - // Check number of results and filterSet flag in explain. - // filterSet is not available in oplog replay mode. - BSONObj explainObj = c->next(); - ASSERT(explainObj.hasField("executionStats")) << explainObj; - BSONObj execStats = explainObj["executionStats"].Obj(); - ASSERT_EQUALS(1, execStats.getIntField("nReturned")); - - ASSERT(!c->more()); + BSONObj explainCmdObj = + BSON("explain" << BSON("find" + << "oplog.querytests.OplogScanGtTsExplain" + << "filter" << BSON("ts" << GT << Timestamp(1000, 1)) << "hint" + << BSON("$natural" << 1)) + << "verbosity" + << "executionStats"); + + auto reply = _client.runCommand(OpMsgRequest::fromDBAndBody("local", explainCmdObj)); + BSONObj explainCmdReplyBody = reply->getCommandReply(); + ASSERT_OK(getStatusFromCommandResult(explainCmdReplyBody)); + + ASSERT(explainCmdReplyBody.hasField("executionStats")) << explainCmdReplyBody; + BSONObj execStats = explainCmdReplyBody["executionStats"].Obj(); + ASSERT_EQUALS(1, execStats.getIntField("nReturned")) << explainCmdReplyBody; } private: |