diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationFunctionExpressions.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationFunctionExpressions.java
index f9b494bc6..160c34df8 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationFunctionExpressions.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/AggregationFunctionExpressions.java
@@ -33,7 +33,7 @@ import org.springframework.util.Assert;
*/
public enum AggregationFunctionExpressions {
- SIZE, GTE;
+ SIZE, CMP, EQ, GT, GTE, LT, LTE, NE;
/**
* Returns an {@link AggregationExpression} build from the current {@link Enum} name and the given parameters.
diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java
index fbe1cdde8..483a7d5eb 100644
--- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java
+++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperation.java
@@ -614,6 +614,78 @@ public class ProjectionOperation implements FieldsExposingAggregationOperation {
return project("size");
}
+ /**
+ * Generates a {@code $cmp} expression (compare to) that compares the value of the field to a given value or field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder cmp(Object compareValue) {
+ return project("cmp", compareValue);
+ }
+
+ /**
+ * Generates a {@code $eq} expression (equal) that compares the value of the field to a given value or field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder eq(Object compareValue) {
+ return project("eq", compareValue);
+ }
+
+ /**
+ * Generates a {@code $gt} expression (greater than) that compares the value of the field to a given value or field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder gt(Object compareValue) {
+ return project("gt", compareValue);
+ }
+
+ /**
+ * Generates a {@code $gte} expression (greater than equal) that compares the value of the field to a given value or
+ * field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder gte(Object compareValue) {
+ return project("gte", compareValue);
+ }
+
+ /**
+ * Generates a {@code $lt} expression (less than) that compares the value of the field to a given value or field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder lt(Object compareValue) {
+ return project("lt", compareValue);
+ }
+
+ /**
+ * Generates a {@code $lte} expression (less than equal) that compares the value of the field to a given value or
+ * field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder lte(Object compareValue) {
+ return project("lte", compareValue);
+ }
+
+ /**
+ * Generates a {@code $ne} expression (not equal) that compares the value of the field to a given value or field.
+ *
+ * @return never {@literal null}.
+ * @since 1.10
+ */
+ public ProjectionOperationBuilder ne(Object compareValue) {
+ return project("ne", compareValue);
+ }
+
/**
* Generates a {@code $slice} expression that returns a subset of the array held by the given field.
* If {@literal n} is positive, $slice returns up to the first n elements in the array.
diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
index 3425cbf9b..e2d08c2f9 100644
--- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
+++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/aggregation/ProjectionOperationUnitTests.java
@@ -19,6 +19,8 @@ import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
import static org.springframework.data.mongodb.core.aggregation.AggregationFunctionExpressions.*;
import static org.springframework.data.mongodb.core.aggregation.Fields.*;
+import static org.springframework.data.mongodb.test.util.IsBsonObject.*;
+import static org.springframework.data.mongodb.util.DBObjectUtils.*;
import java.util.Arrays;
import java.util.List;
@@ -396,6 +398,90 @@ public class ProjectionOperationUnitTests {
is((Object) new Document("$slice", Arrays.