public void updateWalletBalance(final String walletId, final BigInteger amount){
var query = query(where("wallets.walletId").is(walletId));
var update = new Update().inc("wallets.$.balance", amount);
mongoTemplate.updateFirst(query, update, Client.class);
}
我收到此异常>'org.springframework.dao.DataIntegrityViolationException'异常。“无法使用非数字参数递增:{wallets。$。balance:“ 100000”}“