diff options
author | Eddie Louie <eddie.louie@mongodb.com> | 2017-08-01 20:16:10 -0400 |
---|---|---|
committer | Eddie Louie <eddie.louie@mongodb.com> | 2017-08-01 20:16:10 -0400 |
commit | 9be0ac031fd016f768297b3647a4b786aa7ae5b6 (patch) | |
tree | 6ec2bf60813939c58d5dbb09daf2ebefbd483469 /src/mongo/db/pipeline/document_source_sort_by_count_test.cpp | |
parent | fd01541d77ca1455c603c411f395d6ce34fab6f1 (diff) | |
download | mongo-9be0ac031fd016f768297b3647a4b786aa7ae5b6.tar.gz |
SERVER-29135 Add post-image lookup to $changeNotification
This reverts commit 2a76bd75d75197d3604643ff2b11d0a8f23c14f9.
Diffstat (limited to 'src/mongo/db/pipeline/document_source_sort_by_count_test.cpp')
-rw-r--r-- | src/mongo/db/pipeline/document_source_sort_by_count_test.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/mongo/db/pipeline/document_source_sort_by_count_test.cpp b/src/mongo/db/pipeline/document_source_sort_by_count_test.cpp index 3e0a007c59b..12975e96149 100644 --- a/src/mongo/db/pipeline/document_source_sort_by_count_test.cpp +++ b/src/mongo/db/pipeline/document_source_sort_by_count_test.cpp @@ -46,8 +46,9 @@ namespace mongo { namespace { -using std::vector; using boost::intrusive_ptr; +using std::list; +using std::vector; /** * Fixture to test that $sortByCount returns a DocumentSourceGroup and DocumentSourceSort. @@ -55,15 +56,15 @@ using boost::intrusive_ptr; class SortByCountReturnsGroupAndSort : public AggregationContextFixture { public: void testCreateFromBsonResult(BSONObj sortByCountSpec, Value expectedGroupExplain) { - vector<intrusive_ptr<DocumentSource>> result = + list<intrusive_ptr<DocumentSource>> result = DocumentSourceSortByCount::createFromBson(sortByCountSpec.firstElement(), getExpCtx()); ASSERT_EQUALS(result.size(), 2UL); - const auto* groupStage = dynamic_cast<DocumentSourceGroup*>(result[0].get()); + const auto* groupStage = dynamic_cast<DocumentSourceGroup*>(result.front().get()); ASSERT(groupStage); - const auto* sortStage = dynamic_cast<DocumentSourceSort*>(result[1].get()); + const auto* sortStage = dynamic_cast<DocumentSourceSort*>(result.back().get()); ASSERT(sortStage); // Serialize the DocumentSourceGroup and DocumentSourceSort from $sortByCount so that we can @@ -111,7 +112,7 @@ TEST_F(SortByCountReturnsGroupAndSort, ExpressionInObjectSpec) { */ class InvalidSortByCountSpec : public AggregationContextFixture { public: - vector<intrusive_ptr<DocumentSource>> createSortByCount(BSONObj sortByCountSpec) { + list<intrusive_ptr<DocumentSource>> createSortByCount(BSONObj sortByCountSpec) { auto specElem = sortByCountSpec.firstElement(); return DocumentSourceSortByCount::createFromBson(specElem, getExpCtx()); } |