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

mongoimport complains invalid character '\x02' in string literal

    • Type: Icon: Bug Bug
    • Resolution: Works as Designed
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 3.4.9
    • Component/s: mongoimport
    • Environment:
      centos6.5 x86_64

      mongoimport failed when the json content contains ascii code like 0x01, 0x02..

      The file content is:

      {"a":"test1","b":"1"}
      {"a":"test2^B","b":"2"}  
      {"a":"test3","b":"4"}
      

      B is not two charachters ( + B)but one which can be input using ctrl+b in vim editor.

      When importing this file using mongoimport -d test -c a --file=test.json, it fails and complains the error:
      Failed: error processing document #2: invalid character '\x02' in string literal
      imported 0 documents

        1. test.json
          0.1 kB
          Cyclamen

            Assignee:
            david.golden@mongodb.com David Golden
            Reporter:
            cyclamen Cyclamen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: