Customize ID Fields
On this page
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.
About this Task
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.
Steps
From the Mapping screen, click a table or collection name on the Schema model pane or diagram view.
From the Schema model pane, click the icon next to a mapping rule.
Click the icon next to the _id field and select Transform to calculated field.
(Optional) Select a BSON type.
(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.
Enter a valid JavaScript expression. For examples, see valid JavaScript expressions.
Click Done and then click Save and close.