public class DefaultIndexOperations extends Object implements IndexOperations
IndexOperations
.Constructor and Description |
---|
DefaultIndexOperations(MongoOperations mongoOperations,
String collectionName)
Creates a new
DefaultIndexOperations . |
DefaultIndexOperations(MongoOperations mongoOperations,
String collectionName,
Class<?> type)
Creates a new
DefaultIndexOperations . |
Modifier and Type | Method and Description |
---|---|
void |
dropAllIndexes()
Drops all indices from this collection.
|
void |
dropIndex(String name)
Drops an index from this collection.
|
void |
ensureIndex(IndexDefinition indexDefinition)
Ensure that an index for the provided
IndexDefinition exists for the collection indicated by the entity
class. |
List<IndexInfo> |
getIndexInfo()
Returns the index information on the collection.
|
void |
resetIndexCache()
Deprecated.
|
public DefaultIndexOperations(MongoOperations mongoOperations, String collectionName)
DefaultIndexOperations
.mongoOperations
- must not be null.collectionName
- must not be null.public DefaultIndexOperations(MongoOperations mongoOperations, String collectionName, Class<?> type)
DefaultIndexOperations
.mongoOperations
- must not be null.collectionName
- must not be null.type
- Type used for mapping potential partial index filter expression. Can be null.public void ensureIndex(IndexDefinition indexDefinition)
IndexOperations
IndexDefinition
exists for the collection indicated by the entity
class. If not it will be created.ensureIndex
in interface IndexOperations
indexDefinition
- must not be null.public void dropIndex(String name)
IndexOperations
dropIndex
in interface IndexOperations
name
- name of index to droppublic void dropAllIndexes()
IndexOperations
dropAllIndexes
in interface IndexOperations
@Deprecated public void resetIndexCache()
IndexOperations
resetIndexCache
in interface IndexOperations
public List<IndexInfo> getIndexInfo()
IndexOperations
getIndexInfo
in interface IndexOperations
Copyright © 2011–2018 Pivotal Software, Inc.. All rights reserved.