标签:题集 def 解决 pem manage conf code size map
一、解决SpringBoot MongoDB插入文档默认生成_class字段问题
@Configuration public class SpringMongoConfig{ @Bean public MongoTemplate mongoTemplate() throws Exception { //remove _class MappingMongoConverter converter = new MappingMongoConverter(mongoDbFactory(), new MongoMappingContext()); converter.setTypeMapper(new DefaultMongoTypeMapper(null)); MongoTemplate mongoTemplate = new MongoTemplate(mongoDbFactory(), converter); return mongoTemplate; } }
@Configuration public class TransactionConfig { @Bean MongoTransactionManager transactionManager(MongoDbFactory factory){ return new MongoTransactionManager(factory); } }
标签:题集 def 解决 pem manage conf code size map
原文地址:https://www.cnblogs.com/yuarvin/p/14686666.html