From 03246f04b8736444a9917768b6616eba86174b83 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Tue, 14 Aug 2018 16:03:40 +0200 Subject: [PATCH] DATAMONGO-2040 - Polishing. Deprecate Index.Duplicates. Remove unused imports. Mention deprecation in What's new. Original pull request: #599. --- .../org/springframework/data/mongodb/core/index/Index.java | 4 ++++ .../data/mongodb/core/query/IndexUnitTests.java | 1 - src/main/asciidoc/new-features.adoc | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java index 65b5bcdbb..20bfee19d 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/Index.java @@ -36,6 +36,10 @@ import org.springframework.util.StringUtils; @SuppressWarnings("deprecation") public class Index implements IndexDefinition { + /** + * @deprecated since 2.1. No longer supported by MongoDB as of server version 3.0. + */ + @Deprecated public enum Duplicates { RETAIN } diff --git a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/IndexUnitTests.java b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/IndexUnitTests.java index ae69e7913..99c45cc20 100644 --- a/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/IndexUnitTests.java +++ b/spring-data-mongodb/src/test/java/org/springframework/data/mongodb/core/query/IndexUnitTests.java @@ -24,7 +24,6 @@ import org.springframework.data.domain.Sort.Direction; import org.springframework.data.mongodb.core.index.GeoSpatialIndexType; import org.springframework.data.mongodb.core.index.GeospatialIndex; import org.springframework.data.mongodb.core.index.Index; -import org.springframework.data.mongodb.core.index.Index.Duplicates; /** * Unit tests for {@link Index}. diff --git a/src/main/asciidoc/new-features.adoc b/src/main/asciidoc/new-features.adoc index 0d0c49702..25e7a1985 100644 --- a/src/main/asciidoc/new-features.adoc +++ b/src/main/asciidoc/new-features.adoc @@ -15,6 +15,7 @@ * <> support and a MongoDB-specific transaction manager implementation. * <> using `@Query(sort=…)`. * <> support through imperative and reactive Template APIs. +* Deprecation of `dropDups` in `@Indexed` and `@CompoundIndex` as MongoDB server 3.0 and newer do not support `dropDups` anymore. [[new-features.2-0-0]] == What's New in Spring Data MongoDB 2.0