From 7856c7264f155b454d5d339ed9e34b7d4a31bb1e Mon Sep 17 00:00:00 2001 From: Christoph Strobl Date: Tue, 12 Dec 2023 08:04:03 +0100 Subject: [PATCH] Polishing. Update IndexOperations javadoc. Add missing parameters and change wording to reflect what the methods actually do. See: #4587 --- .../data/mongodb/core/index/IndexOperations.java | 6 ++++-- .../data/mongodb/core/index/ReactiveIndexOperations.java | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperations.java index 3af895cf9..a191e6fc0 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/IndexOperations.java @@ -32,13 +32,15 @@ public interface IndexOperations { * class. If not it will be created. * * @param indexDefinition must not be {@literal null}. + * @return the index name. */ String ensureIndex(IndexDefinition indexDefinition); /** - * Drops an index from this collection. + * Alters the index with given {@literal name}. * - * @param name name of index to hide. + * @param name name of index to change. + * @param options index options. * @since 4.1 */ void alterIndex(String name, IndexOptions options); diff --git a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveIndexOperations.java b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveIndexOperations.java index e0a02ffe2..543d91f52 100644 --- a/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveIndexOperations.java +++ b/spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/index/ReactiveIndexOperations.java @@ -32,14 +32,15 @@ public interface ReactiveIndexOperations { * class. If not it will be created. * * @param indexDefinition must not be {@literal null}. + * @return a {@link Mono} emitting the name of the index on completion. */ Mono ensureIndex(IndexDefinition indexDefinition); /** * Alters the index with given {@literal name}. * - * @param name name of index to hide. - * @param + * @param name name of index to change. + * @param options index options. * @since 4.1 */ Mono alterIndex(String name, IndexOptions options);