The standard javascript only supports 1 type for numbers, which is a
double (64bit floating point).
There is no standard long.
So mongo represents a standard long as a NumberLong object which
contains a field "floatApprox" which is the float approximation of the
long value.
If the long cannot be precisely represented by a double (happens for
large numbers), it will actually store 2 more fields top & bottom.
Unfortunately the JS engine does not allow to override the operators,
so you must handle it as an object.
You can call toNumber() to get the double value, but if your number is
larger than an int make sure to check if top/bottom fields are set, in
which case value may not be exact.