Docs Menu
Docs Home
/ /

Modify Fields in Your Compass Entity-Relationship Diagram

You can modify your existing entity-relationship diagram in Compass to plan changes to your data model without affecting your actual data.

In the Data Modeling tab, you can:

  • Add or remove fields

  • Change field data types

  • Rename fields

Note

Any changes you make to your entity-relationship diagram won't affect your actual database.

You must have an existing diagram in Compass to modify the fields. To create a new diagram, see Generate an Entity-Relationship Diagram in Compass.

To add a new field to a collection in your entity-relationship diagram:

1

In the left sidebar, click Data Modeling.

2

From the Data Modeling tab, open your diagram.

3

To add a new field, click the icon in the upper-right corner of one of your collection nodes. A new field appears in the collection node.

Once you add a field, you can edit the field's properties, including:

  • Renaming the field.

  • Changing the field's data type.

  • Adding relationships.

To rename a field in your entity-relationship diagram:

1

In the left sidebar, click Data Modeling.

2

From the Data Modeling tab, open your diagram.

3

Click one of your fields in the diagram. The field side panel opens on the right side of the screen.

To change the data type of a field in your entity-relationship diagram:

1

In the left sidebar, click Data Modeling.

2

From the Data Modeling tab, open your diagram.

3

Click one of your fields in the diagram. The field side panel opens on the right side of the screen.

4

In the Datatype drop-down menu, select the datatypes that you want to assign to the field. Because data in MongoDB has a flexible schema model, you can specify multiple data types for a field. If a field contains multiple data types, Compass labels the field as (mixed) in the diagram.

To delete a field from your diagram:

1

In the left sidebar, click Data Modeling.

2

From the Data Modeling tab, open your diagram.

3

Click one of your fields in the diagram. The field side panel opens on the right side of the screen.

4

In the side panel, click the icon.

Back

Modify Collections

On this page