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

Importing a document with an empty object causes other objects on the same level to also be empty

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 1.33.0
    • 1.33.1
    • Import/Export
    • None
    • Not Needed

    Description

      Problem Statement/Rationale

      Importing a JSON file that looks like this (with empty objects: "fr": {}, "it": {}) via the Compass Add Data -> Import File UI

       

      [
      {
        "_id": {
          "$oid": "62e39685cc234a6c40cf3435"
        },
        "key": "productcreator.fields.renderjob.group",
        "namespace": "default",
        "__v": 0,
        "created": {
          "$numberLong": "1659082373113"
        },
        "lastUpdated": {
          "$numberLong": "1659082373113"
        },
        "locales": {
          "de": {
            "default": "Gruppe"
          },
          "en": {
            "default": "Group"
          },
          "fr": {},
          "it": {}
        }
      }
      ] 

       

       

      will import it like (Objects for "de": {"default": "Gruppe"},"en": {"default": "Group"}, are missing)

      Steps to Reproduce

      Import the localesnotworking.json via the Compass Add Data -> Import File UI

      localesnotworking.json

      Expected Results

      Import it like this:

       

      Actual Results

      is imported like this: (Objects for "de": {"default": "Gruppe"},"en": {"default": "Group"}, are missing)

      Additional Notes

      We are regularly exporting data from one Cluster to another, we use the export collection feature with a filter in the Compass UI, and are importing it again in the target cluster with the Add Data feature.

      This behavior does not occur when we import a document that does not include empty objects:

      [
      {
        "_id": {
          "$oid": "62e39685cc234a6c40cf3435"
        },
        "key": "productcreator.fields.renderjob.group",
        "namespace": "default",
        "__v": 0,
        "created": {
          "$numberLong": "1659082373113"
        },
        "lastUpdated": {
          "$numberLong": "1659082373113"
        },
        "locales": {
          "de": {
            "default": "Gruppe"
          },
          "en": {
            "default": "Group"
          },
          "fr": {
            "default": "Group"
          },
          "it": {
            "default": "Group"
          }
        }
      }
      ] 

      Attachments

        Activity

          People

            Unassigned Unassigned
            daniel.rabanser@crystal-design.com Daniel Rabanser
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: