Class DefaultReactiveIndexOperations
java.lang.Object
org.springframework.data.mongodb.core.DefaultReactiveIndexOperations
- All Implemented Interfaces:
ReactiveIndexOperations
Default implementation of
ReactiveIndexOperations
.- Since:
- 2.0
- Author:
- Mark Paluch, Christoph Strobl
-
Constructor Summary
ConstructorDescriptionDefaultReactiveIndexOperations
(ReactiveMongoOperations mongoOperations, String collectionName, QueryMapper queryMapper) Creates a newDefaultReactiveIndexOperations
.DefaultReactiveIndexOperations
(ReactiveMongoOperations mongoOperations, String collectionName, QueryMapper queryMapper, Class<?> type) Creates a newDefaultReactiveIndexOperations
. -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>
alterIndex
(String name, IndexOptions options) Alters the index with given name.reactor.core.publisher.Mono<Void>
Drops all indices from this collection.reactor.core.publisher.Mono<Void>
Drops an index from this collection.reactor.core.publisher.Mono<String>
ensureIndex
(IndexDefinition indexDefinition) Ensure that an index for the providedIndexDefinition
exists for the collection indicated by the entity class.reactor.core.publisher.Flux<IndexInfo>
Returns the index information on the collection.
-
Constructor Details
-
DefaultReactiveIndexOperations
public DefaultReactiveIndexOperations(ReactiveMongoOperations mongoOperations, String collectionName, QueryMapper queryMapper) Creates a newDefaultReactiveIndexOperations
.- Parameters:
mongoOperations
- must not be null.collectionName
- must not be null.queryMapper
- must not be null.
-
DefaultReactiveIndexOperations
public DefaultReactiveIndexOperations(ReactiveMongoOperations mongoOperations, String collectionName, QueryMapper queryMapper, Class<?> type) Creates a newDefaultReactiveIndexOperations
.- Parameters:
mongoOperations
- must not be null.collectionName
- must not be null.queryMapper
- must not be null.type
- used for mapping potential partial index filter expression, must not be null.
-
-
Method Details
-
ensureIndex
Description copied from interface:ReactiveIndexOperations
Ensure that an index for the providedIndexDefinition
exists for the collection indicated by the entity class. If not it will be created.- Specified by:
ensureIndex
in interfaceReactiveIndexOperations
- Parameters:
indexDefinition
- must not be null.- Returns:
- a
Mono
emitting the name of the index on completion.
-
alterIndex
Description copied from interface:ReactiveIndexOperations
Alters the index with given name.- Specified by:
alterIndex
in interfaceReactiveIndexOperations
- Parameters:
name
- name of index to change.options
- index options.
-
dropIndex
Description copied from interface:ReactiveIndexOperations
Drops an index from this collection.- Specified by:
dropIndex
in interfaceReactiveIndexOperations
- Parameters:
name
- name of index to drop
-
dropAllIndexes
Description copied from interface:ReactiveIndexOperations
Drops all indices from this collection.- Specified by:
dropAllIndexes
in interfaceReactiveIndexOperations
-
getIndexInfo
Description copied from interface:ReactiveIndexOperations
Returns the index information on the collection.- Specified by:
getIndexInfo
in interfaceReactiveIndexOperations
- Returns:
- index information on the collection
-