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

Ints are converted to Float in Javascript

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 0.9.3
    • Component/s: JavaScript
    • Labels:
      None
    • Environment:
      Self-built Linux 64-bit, current to master head:
      Fri May 22 02:45:00 git version: 87372071fca2cd49a67085bc80d1c1a3fb9b2202

      Running latest Ruby driver, also built from latest git: dc44751d2fb18a8be1f301ecac24e675d4da2b0e

      When integers are inserted using javascript either in the Mongo shell, or using db.eval(), they seem to be converted to Floats.

      In the attached Ruby code the db.eval() created document has converted the integer 1 value into a float 1 value.

      Similarly, if you insert a

      { "test" : 1 }

      document from Mongo shell, and then retrieve it using the Ruby driver it comes back as a Float 1.0.

            Assignee:
            eliot Eliot Horowitz (Inactive)
            Reporter:
            goosmurf Yun Huang Yong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: