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

api: nested documents in json should stay nested in SchemaParser struct

    • Type: Icon: Task Task
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: schema.rs
    • None
    • 5
    • Iteration Xiaolongbao

      current output:

       

      {
            "name": "city",
            "path": "address.city",
            "count": 0,
            "field_type": null,
            "probability": null,
            "has_duplicates": true,
            "types": [
              {
                "name": "String",
                "path": "address.city",
                "count": 99,
                "bsonType": "String",
                "probability": null,
                "values": [
                  {
                    "Str": "El Paso, Texas"
                  },
                  {
                    "Str": "El Paso, Texas"
                  },
                ]
              }
            ]
      },
      {
            "name": "street",
            "path": "address.street",
            "count": 0,
            "field_type": null,
            "probability": null,
            "has_duplicates": false,
            "types": [
              {
                "name": "String",
                "path": "address.street",
                "count": 99,
                "bsonType": "String",
                "probability": null,
                "values": [
                  {
                    "Str": "133 Aloha Ave"
                  },
                  {
                    "Str": "290 East George Rd"
                  }
                ]
              }
            ]
      }
      

       

      expected output:

      {
          "name": "address",
          "path": "address",
          "count": 100,
          "types": [{
            "name": "Document",
            "bsonType": "Document",
            "path": "address",
            "count": 100,
            "fields": [
               {
                "name": "city",
                "path": "address.city",
                "count": 100,
                "types": [{
                  "name": "String",
                  "bsonType": "String",
                  "path": "address.city",
                  "count": 100,
                  "values": ["El Paso, Texas", "El Paso, Texas"]
                }]
               }, {
                 "name": "street",
                 "path": "address.street",
                 "count": 100,
                 "types": [{
                   "name": "String",
                   "bsonType": "String",
                   "path": "address.street",
                   "count": 100,
                   "values": ["133 Aloha Ave", "290 East George Rd"]
                 }]
               }]
            }]
      }
      
      

            Assignee:
            irina.shestak@mongodb.com Irina Shestak (Inactive)
            Reporter:
            irina.shestak@mongodb.com Irina Shestak (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: