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

mongoexport uses hex escapes for basic characters in JSON output

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Backport Requested:
      v4.0
    • Case:

      Description

      14:09:50@test>db.char_test.find()
      { "_id" : "< >" }
      14:09:52@test>^C
      bye
      ./mongoexport --db test -c char_test
      2018-08-24T14:10:06.798+1000    connected to: localhost
      {"_id":"\u003c \u003e"}
      2018-08-24T14:10:06.801+1000    exported 1 record
      

      mongoexport does this even when using the output to file option.

      mongoexport produces correct output when using CSV mode. That is, the problem only occurs in JSON mode.

      The JSON specification says that all text between code points 0020 and 01FF are fine to be encoded as characters as is (except forward-slash and quotes) – not hex.

      I tested with 4.0.0 but I'm told it happens in 3.6 as well.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            andrew.ryder Andrew Ryder (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: