Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

mongodb spring boot index usage 0

MongoDatabaseFactory dbFactory = new SimpleMongoClientDatabaseFactory(...);
DefaultDbRefResolver dbRefResolver = new DefaultDbRefResolver(dbFactory);

MongoMappingContext mappingContext = new MongoMappingContext();
mappingContext.setAutoIndexCreation(true);                
// ...
mappingContext.afterPropertiesSet();

MongoTemplate template = new MongoTemplate(dbFactory, new MappingMongoConverter(dbRefResolver, mappingContext));
 
PREVIOUS NEXT
Tagged: #mongodb #spring #boot #index #usage
ADD COMMENT
Topic
Name
1+1 =