[COMPASS-3559] CSV export not working properly with new line character Created: 10/Apr/19  Updated: 16/Aug/19  Resolved: 16/Aug/19

Status: Closed
Project: Compass
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Roswitha Remling (Inactive) Assignee: Unassigned
Resolution: Won't Fix Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

MAC OS Version 10.13.6


Attachments: PNG File image-2019-04-10-11-17-31-607.png     PNG File image-2019-04-10-11-20-11-784.png     PNG File image-2019-04-10-11-21-15-740.png     PNG File image-2019-04-10-11-26-13-401.png     PNG File screenshot-1.png     PNG File screenshot-2.png     PNG File screenshot-3.png    
Issue Links:
Tested
tested by COMPASS-3824 Test behavior of new feature in relat... Closed

 Description   

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


 Comments   
Comment by Massimiliano Marcon [ 16/Aug/19 ]

We are reimplementing the import/export feature so we won't fix existing bugs. However, we will use existing bugs as a guideline for testing the new implementation.

Generated at Wed Feb 07 22:33:33 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.