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

Importing a single JSON document should work

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 1.36.0
    • Affects Version/s: None
    • Component/s: Import/Export
    • None

      Problem Description

      When a json file contains single document instead of array of documents, import process actually imports values of the keys instead of the value itself. For example, if you have a file with following content:

      {
        someKey: { val: 1 },
        anotherKey: { val: 2 }
      }
      

      import process will import two documents val: 1 and val: 2.

      This is not expected and can not only lead to weird data being added to the database, but also to very confusing error messages if values are not supported document types

      Steps to Reproduce

      Described above

      Expected Results

      A single document is imported

      Actual Results

      Described above

      Additional Notes

      Having multiple line separated files (as in LDJSON) should also work when importing

            Assignee:
            Unassigned Unassigned
            Reporter:
            sergey.petushkov@mongodb.com Sergey Petushkov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: