我正在使用Spring Data Mongo 2.1.5.RELEASE将我的Spring Boot 1.5.15服务连接到MongoDB 3.2。此版本的Mongo的问题是字段属性名不能包含以下字符
$
:
Restrictions on Field Names
.
尝试使用具有此类字符的属性时,我得到以下错误:
com.mongodb.MongoCommandException: Command failed with error 52 (DollarPrefixedFieldName): 'The dollar ($) prefixed field '$NAME' in 'fields.$NAME' is not valid for storage.'
有没有办法指导
MappingMongoConverter
更改字符
$
在数据库的I/O过程中?
谢谢。