I have three tables in one database. These tables have a foreign key between them. Table 1 is the master of Table 2, and Table 2 is the master of Table 3.
I want to get data values ββand convert in a MongoDB document as follows:
{
"_id" : ObjectId("cf3977abf592d19962ff7982"),
"T1Column1" : "Lorem Ipsum",
"T1Column2" : ISODate("2015-11-27T16:04:24.000Z"),
"Table2" : [
{
"T2Column1" : NumberLong(1),
"T2Column2" : "Lorem Ipsum",
"Table3" : [
{
"T3Column1" : "Lorem Ipsum",
"T3Column2" : "Lorem Ipsum"
},
{
"T3Column1" : "Lorem Ipsum",
"T3Column2" : "Lorem Ipsum"
}
]
},
{
"T2Column1" : NumberLong(2),
"T2Column2" : "Lorem Ipsum",
"Table3" : [
{
"T3Column1" : "Lorem Ipsum1",
"T3Column2" : "Lorem Ipsum"
},
{
"T3Column1" : "Lorem Ipsum2",
"T3Column2" : "Lorem Ipsum"
}
]
}
]
}
I'm already trying to use the βMongo document pathβ at the MongoDB output stage, but it is not possible to use βupsertβ for subdocuments, as we can see in the MongoDB Ouput Document :

How can I do this using Pentaho Data Integration (PDI)?
source
share