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

mongoexport problem on data with quotes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker - P1
    • Resolution: Fixed
    • 3.2.1
    • 3.2.2, 3.0.10, 3.3.1
    • mongoexport
    • None
    • OSX, Amazon Linux
    • Server Tools F (01/29/16)
    • v3.2, v3.0

    Description

      This is a regression from 2.6.x.

      > db.artists.insert({ "name" : "Andy Warhol", "genome" :

      { "Pop Art" : 10 }

      })
      WriteResult(

      { "nInserted" : 1 }

      )

      > db.artists.insert({ "name" : "Quoted Andy Warhol", "genome" :

      { "\"Pop Art\"" : 10 }

      })
      Cannot use 'commands' readMode, degrading to 'legacy' mode
      WriteResult(

      { "nInserted" : 1 }

      )

      > db.artists.find()
      { "_id" : ObjectId("5699157cc42b4297c59e8165"), "name" : "Andy Warhol", "genome" :

      { "Pop Art" : 10 }

      }
      { "_id" : ObjectId("56991584c42b4297c59e8166"), "name" : "Quoted Andy Warhol", "genome" :

      { ""Pop Art"" : 10 }

      }

      > exit
      bye

      /tmp$ mongoexport --db test -c artists
      2016-01-15T10:51:52.266-0500 connected to: localhost
      {"_id":

      {"$oid":"5699157cc42b4297c59e8165"}

      ,"name":"Andy Warhol","genome":{"Pop Art":10.0}}
      2016-01-15T10:51:52.284-0500 Failed: json: error calling MarshalJSON for type bsonutil.MarshalD: cannot marshal [

      {"Pop Art" 10}

      ]: json: error calling MarshalJSON for type bsonutil.MarshalD: invalid character 'P' after object key

      Attachments

        Issue Links

          Activity

            People

              gabriel.russell@mongodb.com Gabriel Russell (Inactive)
              dblock Daniel Doubrovkine
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: