- Each numeric conversion can convert from any numeric type or from a string (truncating if necessary).
- Calling $toInt on an int is a no-op, similarly for other conversions.
- If the input is of a type or value that cannot be converted:
$toInt, $toLong, $toDouble, $toDecimal accept only int, long, double, decimal, and strings that can be interpreted as the above. $toString accepts anything that can be turned into output that is parseable by the mongo shell.
There are situations where I want to use a number as (part of) a string but $concat will only take strings and not numbers. And there are other times where I have a string of a number "2012" and I want to use it as a number and there is no operator to do this.
Seems painful to fall back to map/reduce solely because someone saves a number or date as a string