Docs Menu
Docs Home
/
Relational Migrator
/ / /

Customize ID Fields

On this page

  • About this Task
  • Steps
  • Learn More

You can customize an _id field as part of your migration job. Customized _id fields allow you to change a field's BSON data type and write custom JavaScript expressions instead of using a project's Key Handling Option. Customized _id fields must evaluate to a unique value.

  • You may want to use customized _id fields to make your _id field more expressive. For example, you can concatenate multiple fields to form a unique _id.

  • You can revert the custom ID changes at any time. The _id field returns to the project's Key Handling Option.

  1. From the Mapping screen, click a table or collection name on the Schema model pane or diagram view.

  2. From the Schema model pane, click the icon next to a mapping rule.

  3. Click the icon next to the _id field and select Transform to calculated field.

  4. (Optional) Select a BSON type.

  5. (Optional) Select a Null handling option.

    • Omit: Null values are not inserted into your destination collection.

    • Insert as null: Null values are inserted into the destination collection.

  6. Enter a valid JavaScript expression. For examples, see valid JavaScript expressions.

  7. Click Done and then click Save and close.

Back

Delete