如何使用MongoTemplate增加BigInteger值?

时间:2019-02-14 12:56:58

标签: java mongodb spring-boot

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”}“

0 个答案:

没有答案