Support NumberLong arithmetic in mongo shell and server JS

XMLWordPrintableJSON

    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Currently, NumberLongs are automatically cast to numbers when arithmetic is performed on them (courtesy of .toNumber()). This means that doing something like trying to subtract two NumberLongs returns a double-precision number, not a NumberLong. This causes a loss of precision, and this in turn means that hashed shard key values can't be manipulated in the shell.

      Supporting natural syntax like NumberLong("...") - NumberLong("...") isn't necessary, it would suffice to be able to do something like NumberLong("...").subtract(NumberLong("...")) and get back a NumberLong.

            Assignee:
            DO NOT USE - Backlog - Platform Team
            Reporter:
            Kevin Pulo
            Votes:
            3 Vote for this issue
            Watchers:
            12 Start watching this issue

              Created:
              Updated: