You can map native objects in your relational schema when you first create a schema map or after you have already created one. In either case, this process is carried out through the Schema Tool Native View dialog.
1. From the Schema Tool's main display, click Add Table(s) button to open the Schema Tool Native View dialog.
A hierarchical view of your native data appears in the window. You can click on nodes to see how objects are nested.
2. Select either Flatten or Normalize. Then select the objects you want to include in your schema.
Flatten has been selected in the following example. A native view of the data is presented. residents corresponds to the native residents collection, address corresponds to an embedded document in the collection, vehicles corresponds to an array in the collection, and so forth.
Normalize has been selected in the following example. Because the Schema Tool handles normalization of objects more than one level deep, you can only select tables when Normalize is selected. However, you can tailor these tables by excluding columns once they have been added to your schema (see Removing Objects from a Schema for details).
3. Click OK.
The Schema Tool's main display appears.
4. Click the Save button to save your modification of the schema map.
This following example shows how the residents collection has been flattened into the relational RESIDENTS table.
Note: Refer to "Mapping Objects to Tables" in the driver documentation for details on how the Schema Tool flattens data.
This following example shows how the residents collection has been normalized into a set of parent-child tables.
Note: Refer to "Mapping Objects to Tables" in the driver documentation for details on how the Schema Tool normalizes data.