-1

I have three tables in one database. These tables have a foreign key between them. Table1 is master from Table2, and Table 2 is master from Table3.

I want to get data values and transform in MongoDB document like this:

{
    "_id" : ObjectId("cf3977abf592d19962ff7982"),
    "T1Column1" : "CLient",
    "T2.LoanTable" : [ 
        {
            "T2Column1" : "Name",
            "T2Column2" : "Saldo",
            "T3.Guarantor" : [ 
                {
                    "T3Column1" : "Name",
                    "T3Column2" : "Saldo"
                }, 
                {
                    "T3Column1" : "Name",
                    "T3Column2" : "Saldo"
                }
            ]
        }, 
        {
            "T2Column1" : "Name",
            "T2Column2" : "Saldo",
            "T3.Guarantor" : [ 
                {
                    "T3Column1" : "Name",
                    "T3Column2" : "Saldo"
                }, 
                {
                    "T3Column1" : "Name",
                    "T3Column2" : "Saldo"
                }
            ]
        }
    ]
}

Step 1 did to ClientTable in MongoDBOutput

ClientTable

Step 2 did to LoanTable

LoanTable

I have problem with third level.

Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69
  • "I have problem with third level" means you already manged to do it for the other two levels? If so, please show us the relevant code and where you have the problems with the third level. – Striezel Nov 22 '16 at 20:09

1 Answers1

0

Third Level I need to populate the level with the hierarchical information