@Service public class MongoDBIndexServiceImpl extends Object implements MongoDBIndexService
构造器和说明 |
---|
MongoDBIndexServiceImpl() |
限定符和类型 | 方法和说明 |
---|---|
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)
根据索引名称删除指定集合的索引
|
public void createIndex(String collection, String indexName, Map<String,org.springframework.data.domain.Sort.Direction> map)
MongoDBIndexService
createIndex
在接口中 MongoDBIndexService
collection
- 集合名称indexName
- 索引名称map
- map.put("添加索引的字段",Direction.ASC/DESC)public List<org.springframework.data.mongodb.core.index.IndexInfo> getIndexInfo(String collection)
MongoDBIndexService
getIndexInfo
在接口中 MongoDBIndexService
collection
- 集合名称public void removeIndexByName(String collection, String indexName)
MongoDBIndexService
removeIndexByName
在接口中 MongoDBIndexService
collection
- 集合名称indexName
- 索引名称public void removeAllIndex(String collection)
MongoDBIndexService
removeAllIndex
在接口中 MongoDBIndexService
collection
- 集合名称