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

MongoDB Compass import corrupts documents

    • Type: Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Priority: Icon: Major - P3 Major - P3
    • 1.41.0
    • Affects Version/s: 1.35.0
    • Component/s: None
    • Environment:
      OS:
      node.js / npm versions:
      Additional info:
    • Not Needed

      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

        1. actual_result.jpg
          57 kB
          Anton Tarasov
        2. expectation.jpg
          305 kB
          Anton Tarasov
        3. person.json
          0.7 kB
          Anton Tarasov

            Assignee:
            Unassigned Unassigned
            Reporter:
            flatleywalker@gmail.com Anton Tarasov
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: