What Should I Do If a MongoDB Field Fails to Be Migrated to the Destination?
Symptom
In a CDM job, a field is added for the source MongoDB and mapped to the destination MongoDB. After the job is executed, the field is not migrated to the destination.
Fault Analysis
- According to the documentation, CDM cannot obtain all columns by obtaining sample values.
- MongoDB is a document database and does not have schemes. When a field is added for the source MongoDB, the JSON key of the first record is obtained in field mapping. CDM supports the combine() function, which can encapsulate non-common columns into one column.
Solution
- When the MongoDB Reader plug-in is used to read data, the combine() function can combine multiple fields in the MongoDB document into a JSON string which is migrated to the destination as a field.
- The destination database decomposes the received data using SQL statements.
This does not affect mapping of the existing fields. combine() returns a JSON string that contains all new fields. Data can be obtained using SQL statements at the destination.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot