location修改的时候直接保存record,或者转换成DbObject都会报错,这样准换之后就好了
if(key.equals("location")&&value!=null){ String valueStr = value.toString(); Map<String,Object> locationMap = (Map<String, Object>) JSON.parse(valueStr); //这个必须转换,否则会报错 record.set("location", MongoKit.toDBObject(locationMap)); continue; }