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

mongoexport uses hex escapes for basic characters in JSON output

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • v4.0

      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.

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

              Created:
              Updated:
              Resolved: