public class DefaultIndexOperations extends Object implements IndexOperations
IndexOperations.| Constructor and Description |
|---|
DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory,
String collectionName,
QueryMapper queryMapper)
Deprecated.
since 2.1. Please use
DefaultIndexOperations(MongoOperations, String, Class). |
DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory,
String collectionName,
QueryMapper queryMapper,
Class<?> type)
Deprecated.
since 2.1. Please use
DefaultIndexOperations(MongoOperations, String, Class). |
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.
|
String |
ensureIndex(IndexDefinition indexDefinition)
Ensure that an index for the provided
IndexDefinition exists for the collection indicated by the entity
class. |
<T> T |
execute(CollectionCallback<T> callback) |
List<IndexInfo> |
getIndexInfo()
Returns the index information on the collection.
|
@Deprecated public DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory, String collectionName, QueryMapper queryMapper)
DefaultIndexOperations(MongoOperations, String, Class).DefaultIndexOperations.mongoDbFactory - must not be null.collectionName - must not be null.queryMapper - must not be null.@Deprecated public DefaultIndexOperations(MongoDatabaseFactory mongoDbFactory, String collectionName, QueryMapper queryMapper, @Nullable Class<?> type)
DefaultIndexOperations(MongoOperations, String, Class).DefaultIndexOperations.mongoDbFactory - must not be null.collectionName - must not be null.queryMapper - must not be null.type - Type used for mapping potential partial index filter expression. Can be null.public DefaultIndexOperations(MongoOperations mongoOperations, String collectionName, @Nullable Class<?> type)
DefaultIndexOperations.mongoOperations - must not be null.collectionName - must not be null or empty.type - can be null.public String ensureIndex(IndexDefinition indexDefinition)
IndexOperationsIndexDefinition exists for the collection indicated by the entity
class. If not it will be created.ensureIndex in interface IndexOperationsindexDefinition - must not be null.public void dropIndex(String name)
IndexOperationsdropIndex in interface IndexOperationsname - name of index to droppublic void dropAllIndexes()
IndexOperationsdropAllIndexes in interface IndexOperationspublic List<IndexInfo> getIndexInfo()
IndexOperationsgetIndexInfo in interface IndexOperations@Nullable public <T> T execute(CollectionCallback<T> callback)
Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.