错误提示
No converter found capable of converting from type [org.bson.BsonUndefined] to type [java.lang.Integer]
原因
mongo bson中有字段是Undefined,无法自动转成Java对象
解决方案
mongo字段有undefined的查询方法: "字段": {'$type':6}
例如: 查出手机归属地undefined,并修正成null,java就可以转换
db.customer.find("phoneLocation": {'$type':6}}).forEach(
function(item){
db.customer.update({"_id":item._id},{"$set":{"phoneLocation":null}},false,true)
}
)