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

mongoexport fails with: 10311 Number nan cannot be represented in JSON

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.1.0
    • Affects Version/s: None
    • Component/s: JavaScript, Tools
    • Labels:
      None
    • Environment:
      osx, mongo_export, macbook pro

      Exporting to JSON using mongoexport any record that contains a float which has value NaN will fail.

      Simple Example:

      {
      "slatlng" : [NaN, NaN]
      }

      Additionally:

      When in the mongo console, you can exclude such records using:

      "slatlng" : {$ne [NaN, NaN]}

      but mongoexport cannot parse this as a valid json query. So you cannot do it.

            Assignee:
            brandon Brandon Diamond
            Reporter:
            rathboma Matthew Rathbone
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: