Docs Menu
Docs Home
/
Relational Migrator
/

Create Rules to MongoDB

On this page

  • About this Task
  • Steps
  • Learn More

Creating mapping rules is how you translate your relational tables into MongoDB collections. You can create mapping rules from either the Relational or MongoDB headers of the schema model pane.

  • Options available on the Add mapping pane depend on the type of mapping rule you are adding. For a full overview of each mapping rule option see:

  • You can configure options for time-series collections. For details, see Time series.

  • You can also create mapping rules based on a destination MongoDB model. For more information, see Create Rule from Relational.

  1. Open a project.

  2. In the left Schema model pane, click on a collection under the MongoDB header.

    This prompts the Mappings pane to open on the right of the screen.

  3. On the Mappings pane, click + Add to create a new mapping rule.

  4. Select the name of the source table from the drop-down.

  5. Define the options for the new mapping rule. When defining the mapping rule, you can:

    • Change the collection name.

      To change the collection name, click the Name text box and enter the new name. Click outside of the text box to save the change. If the name is already in use, you receive a validation error.

    • Change field names.

    • Include or exclude a field from your sync job by clicking the icon next to the field name.

  6. Optionally, if you want to select a BSON type or set null handling rules for your mapping rule:

    1. Click the icon next to the field you want to customize.

    2. Select a BSON type.

    3. Select a Null handling option.

    • Insert as null: preserves null values, and nulls are inserted into your destination collection.

    • Omit: skips any null values, and nulls are not inserted into the destination collection.

    You can view a field's Original name and Original type in the expanded customized field menu.

    Note

    For additional details on field customization and data type conversions, see field customizations.

  7. Click Save and close.

To learn more about managing mapping rules, see:

← Create Rules From Relational