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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • 1.33.1
    • Affects Version/s: 1.33.0
    • Component/s: Import/Export
    • Labels:
      None
    • Not Needed

      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"
          }
        }
      }
      ] 

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

              Created:
              Updated:
              Resolved: