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

XMLWordPrintableJSON

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

      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 Diamond (Inactive)
            Reporter:
            Matthew Rathbone
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: