i have a document structure in MongoDB with nested array of objects
{
"_id" : ObjectId("564f9ca55fc3ca3cad383de4"),
"deviceId" : "deviceId",
"deviceType" : "CM",
"cmMacAddress" : "00:00:00:00:00:00",
"portCapacity" : 0.0,
"make" : "CISCO",
"model" : "CI123",
"activationStatus" : "READY",
"service" : [
{
"serviceId" : "serviceId",
"rateCode" : "1AA",
"type" : "DATA",
"rank" : "1",
"activationStatus" : "READY"
},
{
"serviceId" : "serviceId",
"rateCode" : "1AB",
"type" : "DATA",
"rank" : "1",
"activationStatus" : "READY"
}
]
}
my requirement is to update rows on oracle table . for each such document there will one entry in the device table and one or more entries in the service table. Any suggestions how to achieve the second part that is split the service array into individual objects which can be inserted into oracle SERVICE table.
{
"_id" : ObjectId("564f9ca55fc3ca3cad383de4"),
"deviceId" : "deviceId",
"deviceType" : "CM",
"cmMacAddress" : "00:00:00:00:00:00",
"portCapacity" : 0.0,
"make" : "CISCO",
"model" : "CI123",
"activationStatus" : "READY",
"service" : [
{
"serviceId" : "serviceId",
"rateCode" : "1AA",
"type" : "DATA",
"rank" : "1",
"activationStatus" : "READY"
},
{
"serviceId" : "serviceId",
"rateCode" : "1AB",
"type" : "DATA",
"rank" : "1",
"activationStatus" : "READY"
}
]
}
my requirement is to update rows on oracle table . for each such document there will one entry in the device table and one or more entries in the service table. Any suggestions how to achieve the second part that is split the service array into individual objects which can be inserted into oracle SERVICE table.