DATAMONGO-757 - Align output of projection operation with MongoDB defaults.
Adjusted FieldProjection to generate an appropriate representation of included / excluded fields (namely :1 for included and :0 for excluded).
Polished guards to handle only _id is allowed to be excluded (DATAMONGO-758).
Original pull request: #76.
pull/73/merge
Thomas Darimont12 years agocommitted byOliver Gierke
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;
@ -60,7 +62,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -60,7 +62,7 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -117,23 +119,29 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -117,23 +119,29 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -387,31 +395,31 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -387,31 +395,31 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@ -423,13 +431,32 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
@@ -423,13 +431,32 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {