Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-1134

Mongoexport should preserve int/double type of 0

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • v3.0

      Mongoexport exports a zero-valued integer as a zero-valued double.
      This means that running through a mongoexport/import cycle changes the type for the field, potentially leading to casting exceptions downstream.

      //given: 
      db.foo.insert({_id:0, double:0.0})
      
      //mongoexport yields:
      {"_id":0.0,"double":0.0}
      
      //should yield:
      {"_id":0  ,"double":0.0}
      

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            achille.brighton Achille Brighton
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: