NumberLong conversion fails for negative numbers
Calculations with documents holding NumberLong values produce wrong results, when negative numbers are involved.
When running the following code in the query editor, -2 is printed, although -1 would be correct:
var val = NumberLong("-1");print(val); // prints -2Also, when you do calculations, it fails:
var v1 = NumberLong("-1"); var v2 = NumberLong("-1"); var result = v1 + v2; print(result); // prints -4This causes some reports we tried to build to be wrong.
Interestingly, it works correctly with NumberInt("-1")
Using NoSQLBooster Version 4.7.3 on MacOS 10.13.6