NodeJS从mongo添加数字

时间:2015-08-24 23:21:41

标签: javascript node.js express

我在快递中有这个基本代码

var currpoints = user.points;
var addedpoints = req.body.points;
var newpoints = currpoints+addedpoints;

user.points = newpoints;

如果currentpoints = 10addedpoints = 100则为var newpoints返回10100。

如何改变这一点,以便增加10 + 100到110?

0 个答案:

没有答案