Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-9973

NumberLong(NumberLong(1)) throws error: Could not convert "NumberLong(1)" to NumberLong

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 3.1.7
    • Affects Version/s: 2.4.2
    • Component/s: JavaScript, Shell
    • None
    • Environment:
      Ubuntu 12.10
    • Fully Compatible
    • ALL
    • Hide

      In the mongodb shell run NumberLong(NumberLong(1))

      Show
      In the mongodb shell run NumberLong(NumberLong(1))
    • Build 7 08/10/15
    • None
    • 0
    • None
    • None
    • None
    • None
    • None
    • None

      Whereas NumberInt(NumberInt(1)) does not.

      Workaround using parseInt

      • NumberLong(parseInt(value, 10))

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            theirishpenguin Declan McGrath
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: