[COMPASS-6512] MongoDB Compass import corrupts documents Created: 12/Feb/23  Updated: 19/Dec/23  Resolved: 19/Dec/23

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

Type: Bug Priority: Major - P3
Reporter: Anton Tarasov Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: first-responder
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

OS:
node.js / npm versions:
Additional info:


Attachments: JPEG File actual_result.jpg     JPEG File expectation.jpg     File person.json    
Documentation Changes: Not Needed

 Description   

Problem Statement/Rationale

I faced a problem with importing the collection in MongoDB Compass. After successfull import the documents within collection are corrupted, almost all fields are ignored, broken nesting and etc.

This problem occurs when there is at least field with name "document" in collection documents. If we change the field name "document" to "doc", the import works correctly. Probably MongoDB Compass is using the field name "document" for some internal reason and when an imported document has the same field name, bad things happen. Idk if there are some others "fragile" field names that can lead to the same effect when importing collection with MongoDB Compass.

Steps to Reproduce

Open Mongo DB with MongoDB Compass, then:

Create the empty collection to perform import in there > select collection -> Collection tab -> Import Data Select file (person.json attached)-> Import 

Expected Results

I expect to see the full document with all the fields. See picture expectation.jpg

Actual Results

I see corrupted document with broken nesting, almost all fields are ignored. See picture actual_result.jpg

Additional Notes

  • Local Mongo DB version: 4.2.7 Community
  • MongoDB Compass version: 1.35.0 (1.35.0)
  • I also created a question on Stackoverflow for this issue, see here


 Comments   
Comment by Rhys Howell [ 19/Dec/23 ]

Hi flatleywalker@gmail.com - thanks for reporting the issue and providing a good description and example. I tried to reproduce this in 1.41.0 and cannot, looks like it has been fixed. In 1.37.0 we did a pretty big overhaul of the import/export experience so it likely landed there.

Please let us know if you update to the newest Compass version and still run into the same issue.
https://www.mongodb.com/try/download/compass 

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