Help Center> Cloud Data Migration> FAQs> Troubleshooting> What Should I Do If a MongoDB Field Fails to Be Migrated to the Destination?
Updated on 2023-06-21 GMT+08:00

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

  1. According to the documentation, CDM cannot obtain all columns by obtaining sample values.
  2. 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

  1. 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.

  2. 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.

Troubleshooting FAQs

more