I need to use AWS Database Migration Service (DMS) to move data from MongoDB to CSV in S3. I can export to CSV in S3 using the table mode and include a header row, however nested arrays within the MongoDB document are being exported as a string breaking the CSV structure:
Mongo:
{ "_id" : 1234,
"dealershipName": "Bills",
"cars": [
{"year": 2013,
"model": "MongoCar",
"mechanicNotes": "Runs great!"},
{"year": 1985,
"model": "DMC-12",
"mechanicNotes": "Great Scott!"}
]
}
CSV in S3:
124,"Bills","[{"year":2013", .........}]",
Can anyone advise how to export the nested arrays inside MongoDB documents to CSV using DMS while maintaining the CSV format (i.e not having a string of the array as a field in the CSV, but broken out into fields - maybe in a separate CSV somehow)?