diff options
author | Anton Korshunov <anton.korshunov@mongodb.com> | 2019-10-11 20:13:48 +0000 |
---|---|---|
committer | evergreen <evergreen@mongodb.com> | 2019-10-11 20:13:48 +0000 |
commit | 70383ed065e8798aafc4394af7c6d2ac92927f41 (patch) | |
tree | 6f7f64aea51387ed436efd36fdc24e6932489be1 /src/mongo/db/query/projection_test.cpp | |
parent | 34719559a9ec4bd494a59d269d227d06b086affb (diff) | |
download | mongo-70383ed065e8798aafc4394af7c6d2ac92927f41.tar.gz |
SERVER-42423 Use ProjectionExecutor in ProjectionStageDefault
Diffstat (limited to 'src/mongo/db/query/projection_test.cpp')
-rw-r--r-- | src/mongo/db/query/projection_test.cpp | 15 |
1 files changed, 0 insertions, 15 deletions
diff --git a/src/mongo/db/query/projection_test.cpp b/src/mongo/db/query/projection_test.cpp index c0044173cd4..c4180584f2f 100644 --- a/src/mongo/db/query/projection_test.cpp +++ b/src/mongo/db/query/projection_test.cpp @@ -229,9 +229,7 @@ TEST(QueryProjectionTest, SortKeyMetaProjectionInExclusionProjection) { // A projection with just a $meta projection defaults to an exclusion projection. auto proj = createProjection("{}", "{foo: {$meta: 'sortKey'}}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), fromjson("{foo: {$meta: 'sortKey'}}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); - ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearPoint]); @@ -241,10 +239,7 @@ TEST(QueryProjectionTest, SortKeyMetaProjectionInExclusionProjection) { TEST(QueryProjectionTest, SortKeyMetaProjectionInExclusionProjectionWithOtherFields) { auto proj = createProjection("{}", "{a: 0, foo: {$meta: 'sortKey'}}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), fromjson("{a: 0, foo: {$meta: 'sortKey'}}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); - - ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearPoint]); ASSERT_TRUE(proj.requiresDocument()); @@ -253,9 +248,7 @@ TEST(QueryProjectionTest, SortKeyMetaProjectionInExclusionProjectionWithOtherFie TEST(QueryProjectionTest, SortKeyMetaProjectionInInclusionProjection) { auto proj = createProjection("{}", "{a: 1, foo: {$meta: 'sortKey'}}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), fromjson("{a: 1, foo: {$meta: 'sortKey'}}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); - ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearPoint]); @@ -265,9 +258,7 @@ TEST(QueryProjectionTest, SortKeyMetaProjectionInInclusionProjection) { TEST(QueryProjectionTest, SortKeyMetaProjectionDoesNotRequireDocument) { auto proj = createProjection("{}", "{a: 1, foo: {$meta: 'sortKey'}, _id: 0}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), fromjson("{a: 1, foo: {$meta: 'sortKey'}, _id: 0}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); - ASSERT_FALSE(proj.requiresDocument()); ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); @@ -277,11 +268,8 @@ TEST(QueryProjectionTest, SortKeyMetaProjectionDoesNotRequireDocument) { TEST(QueryProjectionTest, SortKeyMetaAndSlice) { auto proj = createProjection("{}", "{a: 1, foo: {$meta: 'sortKey'}, _id: 0, b: {$slice: 1}}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), - fromjson("{a: 1, foo: {$meta: 'sortKey'}, _id: 0, b: {$slice: 1}}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); ASSERT_TRUE(proj.requiresDocument()); - ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearPoint]); @@ -291,11 +279,8 @@ TEST(QueryProjectionTest, SortKeyMetaAndElemMatch) { auto proj = createProjection("{}", "{a: 1, foo: {$meta: 'sortKey'}, _id: 0, b: {$elemMatch: {a: 1}}}"); - ASSERT_BSONOBJ_EQ(proj.getProjObj(), - fromjson("{a: 1, foo: {$meta: 'sortKey'}, _id: 0, b: {$elemMatch: {a: 1}}}")); ASSERT_TRUE(proj.metadataDeps()[DocumentMetadataFields::kSortKey]); ASSERT_TRUE(proj.requiresDocument()); - ASSERT_FALSE(proj.requiresMatchDetails()); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearDist]); ASSERT_FALSE(proj.metadataDeps()[DocumentMetadataFields::kGeoNearPoint]); |