public interface MongoDBIndexService
限定符和类型 | 方法和说明 |
---|---|
void |
createIndex(String collection,
String indexName,
Map<String,org.springframework.data.domain.Sort.Direction> map)
向指定集合设置索引
|
List<org.springframework.data.mongodb.core.index.IndexInfo> |
getIndexInfo(String collection)
获取指定集合中的索引信息
|
void |
removeAllIndex(String collection)
删除指定集合中的所有索引
|
void |
removeIndexByName(String collection,
String indexName)
根据索引名称删除指定集合的索引
|
void createIndex(String collection, String indexName, Map<String,org.springframework.data.domain.Sort.Direction> map)
collection
- 集合名称indexName
- 索引名称map
- map.put("添加索引的字段",Direction.ASC/DESC)List<org.springframework.data.mongodb.core.index.IndexInfo> getIndexInfo(String collection)
collection
- 集合名称void removeIndexByName(String collection, String indexName)
collection
- 集合名称indexName
- 索引名称void removeAllIndex(String collection)
collection
- 集合名称