Spring 数据索引自动创建

Spring Data index autocreate

Spring数据Mongo是否可以根据Repository方法自动创建索引?也许有一些第三方插件或注释?也许有 API(提供请求的字段)可以帮助我完成这项任务?

在注释 @EnableMongoRepositories 中你需要设置 属性 createIndexesForQueryMethods((doc)) to true and enable automatic index creation(doc).