Inherit fields from previous operation if at least one field is excluded. Extend FieldsExposingAggregationOperation to conditionally inherit fields.
Backport to Java 6 code.
Original pull request: #538.
@ -169,6 +169,14 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
@@ -169,6 +169,14 @@ public abstract class BucketOperationSupport<T extends BucketOperationSupport<T,
@ -62,6 +62,14 @@ public class CountOperation implements FieldsExposingAggregationOperation {
@@ -62,6 +62,14 @@ public class CountOperation implements FieldsExposingAggregationOperation {
@ -96,6 +96,14 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
@@ -96,6 +96,14 @@ public class FacetOperation implements FieldsExposingAggregationOperation {
@ -132,6 +132,14 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@@ -132,6 +132,14 @@ public class GraphLookupOperation implements InheritsFieldsAggregationOperation
@ -395,6 +395,14 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@@ -395,6 +395,14 @@ public class GroupOperation implements FieldsExposingAggregationOperation {
@ -73,6 +73,14 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
@@ -73,6 +73,14 @@ public class LookupOperation implements FieldsExposingAggregationOperation, Inhe
privatestaticfinalStringEXCLUSION_ERROR="Exclusion of field %s not allowed. Projections by the mongodb "
+"aggregation framework only support the exclusion of the %s field!";
privatefinalList<Projection>projections;
@ -183,6 +182,25 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -183,6 +182,25 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1332,6 +1350,13 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1332,6 +1350,13 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -1639,7 +1664,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -1639,7 +1664,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -95,6 +95,14 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
@@ -95,6 +95,14 @@ public class ReplaceRootOperation implements FieldsExposingAggregationOperation
@ -196,6 +198,20 @@ public class TypeBasedAggregationOperationContextUnitTests {
@@ -196,6 +198,20 @@ public class TypeBasedAggregationOperationContextUnitTests {
@ -352,18 +368,13 @@ public class TypeBasedAggregationOperationContextUnitTests {
@@ -352,18 +368,13 @@ public class TypeBasedAggregationOperationContextUnitTests {