DATAMONGO-2040 - Deprecate Indexed.dropDups and CompoundIndex.dropDups.

Add deprecation warning and remove options no longer in use.

Original pull request: #599.
This commit is contained in:
Christoph Strobl
2018-08-09 08:11:57 +02:00
committed by Mark Paluch
parent 029d50e526
commit 50070dfc64
5 changed files with 19 additions and 23 deletions

View File

@@ -2828,13 +2828,13 @@ The `IndexOperations` interface has the `getIndexInfo` method that returns a lis
[source,java]
----
template.indexOps(Person.class).ensureIndex(new Index().on("age", Order.DESCENDING).unique(Duplicates.DROP));
template.indexOps(Person.class).ensureIndex(new Index().on("age", Order.DESCENDING).unique());
List<IndexInfo> indexInfoList = template.indexOps(Person.class).getIndexInfo();
// Contains
// [IndexInfo [fieldSpec={_id=ASCENDING}, name=_id_, unique=false, dropDuplicates=false, sparse=false],
// IndexInfo [fieldSpec={age=DESCENDING}, name=age_-1, unique=true, dropDuplicates=true, sparse=false]]
// [IndexInfo [fieldSpec={_id=ASCENDING}, name=_id_, unique=false, sparse=false],
// IndexInfo [fieldSpec={age=DESCENDING}, name=age_-1, unique=true, sparse=false]]
----
[[mongo-template.index-and-collections.collection]]