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

mongoimport complains invalid character '\x02' in string literal

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • 3.4.9
    • None
    • mongoimport
    • centos6.5 x86_64

    Description

      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

      Attachments

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: