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

mongoexport problem on data with quotes

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Blocker - P1 Blocker - P1
    • 3.2.2, 3.0.10, 3.3.1
    • Affects Version/s: 3.2.1
    • Component/s: mongoexport
    • None
    • Environment:
      OSX, Amazon Linux
    • Server Tools F (01/29/16)
    • v3.2, v3.0

      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

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

              Created:
              Updated:
              Resolved: