1
String json ={"underlying":{"Not-included":"238","Apache-2.0":"1"}}  
DBObject dbObject = (DBObject) JSON.parse(json);

java.lang.IllegalArgumentException: Invalid BSON field name Apache-2.0

How to replace dot easily using above parsing?

Pang
  • 9,564
  • 146
  • 81
  • 122
uma
  • 11
  • 4
  • Possible duplicate of [MongoDB dot (.) in key name](http://stackoverflow.com/questions/12397118/mongodb-dot-in-key-name) – Marc Tarin Apr 21 '17 at 08:46
  • No @MarcTarin it is not duplicate I want to know is it possible to do in the above approach using some kind of mongo configurations that makes job easy. mappingMongoConverter.setMapKeyDotReplacement("_"); – uma Apr 21 '17 at 12:01

0 Answers0