Module spring.data.mongodb
Interface IndexOperations
- All Known Subinterfaces:
IndexOperationsAdapter
- All Known Implementing Classes:
DefaultIndexOperations
public interface IndexOperations
Index operations on a collection.
- Author:
- Mark Pollack, Oliver Gierke, Christoph Strobl, Jens Schauder
-
Method Summary
Modifier and TypeMethodDescriptionvoidalterIndex(String name, IndexOptions options) Drops an index from this collection.voidDrops all indices from this collection.voidDrops an index from this collection.ensureIndex(IndexDefinition indexDefinition) Ensure that an index for the providedIndexDefinitionexists for the collection indicated by the entity class.Returns the index information on the collection.
-
Method Details
-
ensureIndex
Ensure that an index for the providedIndexDefinitionexists for the collection indicated by the entity class. If not it will be created.- Parameters:
indexDefinition- must not be null.
-
alterIndex
Drops an index from this collection.- Parameters:
name- name of index to hide.- Since:
- 4.1
-
dropIndex
Drops an index from this collection.- Parameters:
name- name of index to drop
-
dropAllIndexes
void dropAllIndexes()Drops all indices from this collection. -
getIndexInfo
Returns the index information on the collection.- Returns:
- index information on the collection
-