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

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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • 2.1.0
    • None
    • JavaScript, Tools
    • None
    • osx, mongo_export, macbook pro

    Description

      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.

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: