Uploaded image for project: 'Compass '
  1. Compass
  2. COMPASS-3559

CSV export not working properly with new line character

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      MAC OS Version 10.13.6

      tested on Compass 1.17.0 in response to case https://support.mongodb.com/case/00561194

      Initially was unable to reproduce by adding new line character(s) by editing document via Compass. Later found out that Compass escapes `/` (This may work as intended but was not clear in testing).

      Then tested in shell

      Please note

      • extra leading space in `b` and `fb`
      • these results differ from customer's example (at this time customer's Compass version is unknown)
      MongoDB Enterprise M0-shard-0:PRIMARY> nl =String.fromCharCode(10)
      MongoDB Enterprise M0-shard-0:PRIMARY> a = "Nature " + nl + " is " + nl + " Great "
      Nature 
       is 
       Great 
      MongoDB Enterprise M0-shard-0:PRIMARY> b = " Nature \n is \n great"
       Nature 
       is 
       great
      MongoDB Enterprise M0-shard-0:PRIMARY> db.items.insert({fa: a, fb : b})
      WriteResult({ "nInserted" : 1 })
      MongoDB Enterprise M0-shard-0:PRIMARY> db.items.find()
      ...
      { "_id" : ObjectId("5cae2effa19c363c59af54c1"), "fa" : "Nature \n is \n Great ", "fb" : " Nature \n is \n great" }
      

      **EXPORT RESULTS**

      • CSV in TextEdit
        _id,text,owner_id
        ...
        ObjectId("5cae2effa19c363c59af54c1"),,
        
      • CSV in XL
      • JSON in TextEdit
        ...
        {"_id":{"$oid":"5cae2effa19c363c59af54c1"},"fa":"Nature \n is \n Great ","fb":" Nature \n is \n great"}
        
      • Compass View of Doc

      And just for completeness' sake, here is the document I edited in compass

      • Compass View

      Please note, adding `\` or `\n` or `\r \n` via compass edit all exported fine into CSV

      • Shell View
        { "_id" : ObjectId("5cad35b8d72322ff983bc072"), "text" : "Natures Bounty Pure Favorite Sweepstakes \\r \\n sdfsdf \\r \\n sdfsdf \\r \\n sdff", "owner_id" : "5cad35af6926e7b8bb4c998a" }
        
      • CSV Export shown in TextEdit
        _id,text,owner_id
        ...
        ObjectId("5cad35b8d72322ff983bc072"),Natures Bounty Pure Favorite Sweepstakes \r \n sdfsdf \r \n sdfsdf \r \n sdff,5cad35af6926e7b8bb4c998a
        
      • CSV Export shown in XL

        1. image-2019-04-10-11-17-31-607.png
          image-2019-04-10-11-17-31-607.png
          38 kB
        2. image-2019-04-10-11-20-11-784.png
          image-2019-04-10-11-20-11-784.png
          9 kB
        3. image-2019-04-10-11-21-15-740.png
          image-2019-04-10-11-21-15-740.png
          13 kB
        4. image-2019-04-10-11-26-13-401.png
          image-2019-04-10-11-26-13-401.png
          17 kB
        5. screenshot-1.png
          screenshot-1.png
          26 kB
        6. screenshot-2.png
          screenshot-2.png
          54 kB
        7. screenshot-3.png
          screenshot-3.png
          11 kB

            Assignee:
            Unassigned Unassigned
            Reporter:
            roswitha.remling@mongodb.com Roswitha Remling (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: