This repository was archived by the owner on Jan 10, 2022. It is now read-only.
Description 2020 -03 -14 0 8 :37 :27.725 WARN 16540 --- [ main ] .m .c .i .MongoPersistentEntityIndexCreator : Automatic index creation will be disabled by default as of Spring Data MongoDB 3. x .
Please use 'MongoMappingContext#setAutoIndexCreation(boolean)' or override 'MongoConfigurationSupport#autoIndexCreation()' to be explicit .
However , we recommend setting up indices manually in an application ready block . You may use index derivation there as well .
> -----------------------------------------------------------------------------------------
> @ EventListener (ApplicationReadyEvent .class )
> public void initIndicesAfterStartup () {
>
> IndexOperations indexOps = mongoTemplate .indexOps (DomainType .class );
>
> IndexResolver resolver = new MongoPersistentEntityIndexResolver (mongoMappingContext );
> resolver .resolveIndexFor (DomainType .class ).forEach (indexOps ::ensureIndex );
> }
> -----------------------------------------------------------------------------------------Reactions are currently unavailable