These are chat archives for Automattic/mongoose

21st
Jul 2016
brandonjfajardo
@brandonjfajardo
Jul 21 2016 03:38
what mongo gui are people using?
Mohamed Nasrullah
@nasr18
Jul 21 2016 06:12
is there anyway to sum string field???
parseInt() not working.
Mohamed Nasrullah
@nasr18
Jul 21 2016 06:37
i need to first $multiple and then $sum. how do i do this???
nacq
@nacq
Jul 21 2016 13:47
@brandonjfajardo Robomongo
LeonineKing1199
@LeonineKing1199
Jul 21 2016 15:21
For parseInt, don't forget you need to specify the base as well. parseInt(convertibleNumber, 10
I also wimp out and will sometimes just use new Number(constructible).valueOf()
Yogesh Patel
@ycpatel813
Jul 21 2016 18:13
@nasr18 using _.map you can sum string first convert string to number then add
if you sum string string is concated
and exactly i did not get what you want to do
var _ = require('lodash')
var a = ['1', '2', '3']
var l = 0;
_.map(a, function (a) {
  l += a * 1
})
console.log(l)
May be this is useful if you find
Thanks
LeonineKing1199
@LeonineKing1199
Jul 21 2016 18:23
Yes, a big :plus1: for taking logic out of the database and its queries.