Make sure map keys don't contain dots in the first place or configure an appropriate replacement!
Map in The 39 or an Make
2023-09-14 09:00:00 时间
遇到
Make sure map keys don't contain dots in the first place or configure an appropriate replacement!
解决方法
package com.tydt.raptor.sdk.configure; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.mongodb.MongoDbFactory; import org.springframework.data.mongodb.core.convert.DbRefResolver; import org.springframework.data.mongodb.core.convert.DefaultDbRefResolver; import org.springframework.data.mongodb.core.convert.MappingMongoConverter; import org.springframework.data.mongodb.core.mapping.MongoMappingContext; @Configuration public class MongoConfig { @Autowired private MongoDbFactory mongoFactory; @Autowired private MongoMappingContext mongoMappingContext; @Bean public MappingMongoConverter mongoConverter() throws Exception { DbRefResolver dbRefResolver = new DefaultDbRefResolver(mongoFactory); MappingMongoConverter mongoConverter = new MappingMongoConverter(dbRefResolver, mongoMappingContext); mongoConverter.setMapKeyDotReplacement("_"); mongoConverter.afterPropertiesSet(); return mongoConverter; } }
相关文章
- HTTP Status 500 - The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
- STL 容器区别:vector、list、deque、set、map的底层实现
- Reporting Service 服务启动时报错The service did not respond to the start or control request in a timely fashion
- python map()
- [Javascript] Compare a Generator to Using Array Map and Filter
- [RxJS] Implement the `map` Operator from Scratch in RxJS
- MR IOException: Type mismatch in key from map的处理
- [RxJS] Implement the `map` Operator from Scratch in RxJS
- [RxJSv& Javascript] forkJoin (reactive Promise.all) & Map
- [AngualrJS NG-redux] Map State and Dispatchers to Redux
- [ES6] When should use Map instead of Object
- map 理解
- ML:分类预测任务中模型评估指标(ER/混淆矩阵ACC、Precision、Recall、AP、mAP、F1、ROC-AUC)简介、使用方法、代码实现、案例应用之详细攻略
- 已解决FutureWarning: The default value of regex will change from True to False in a future version. In
- Spark SQL 源代码分析之 In-Memory Columnar Storage 之 in-memory query
- ZOJ 3674 Search in the Wiki(字典树 + map + vector)
- Go语言自学系列 | go语言遍历map
- 解决办法:The name 'Response' does not exist in the current context
- Hive基础07、Hive引入Map
- Couldn‘t save map file [closed] ROS-map_server 保存地图