> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

# Modify Fields in Your Compass Entity-Relationship Diagram

MongoDB Compass Readonly Edition will be deprecated in a future release. To replicate the read-only behavior in a standard Compass edition, assign users [`read`](https://www.mongodb.com/docs/manual/reference/built-in-roles.md#mongodb-authrole-read) access at the database level and enable the [readOnly](https://www.mongodb.com/docs/compass/settings/read-only.md#std-label-compass-read-only) option in Compass.

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

## About this Task

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.

## Before You Begin

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.](https://www.mongodb.com/docs/compass/data-modeling/generate-diagram.md#std-label-compass-create-data-model-diagram)

## Steps

### Add a New Field

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

1. Open the Data Modeling tab

   In the left sidebar, click  Data Modeling.

2. Open your entity-relationship diagram

   From the  Data Modeling tab, open your diagram.

3. Add a new field

   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.](https://www.mongodb.com/docs/compass/data-modeling/modify-fields.md#std-label-compass-data-model-rename-field)

   - [Changing the field's data type.](https://www.mongodb.com/docs/compass/data-modeling/modify-fields.md#std-label-compass-data-model-data-type)

   - [Adding relationships.](https://www.mongodb.com/docs/compass/data-modeling/relationships.md#std-label-compass-data-modeling-relationships)

### Rename a Field

To rename a field in your entity-relationship diagram:

1. Open the Data Modeling tab

   In the left sidebar, click  Data Modeling.

2. Open your entity-relationship diagram

   From the  Data Modeling tab, open your diagram.

3. Open the Field Properties side panel

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

   Alternatively, you can double-click the field type in the collection node to open the drop-down menu.

### Change a Field's Data Type

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

1. Open the Data Modeling tab

   In the left sidebar, click  Data Modeling.

2. Open your entity-relationship diagram

   From the  Data Modeling tab, open your diagram.

3. Open the Field Properties side panel

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

   Alternatively, you can double-click the field type in the collection node to open the drop-down menu.

4. Select a new data type

   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.

### Remove a Field

To delete a field from your diagram:

1. Open the Data Modeling tab

   In the left sidebar, click  Data Modeling.

2. Open your entity-relationship diagram

   From the  Data Modeling tab, open your diagram.

3. Open the Field Properties side panel

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

   Alternatively, you can double-click the field type in the collection node to open the drop-down menu.

4. Delete the field

   In the side panel, click the  icon.

## Next Steps

- [Modify Collections in Your Compass Entity-Relationship Diagram](https://www.mongodb.com/docs/compass/data-modeling/modify-collections.md#std-label-compass-modify-data-model-collections)

- [Manage Relationships in Your Compass Entity-Relationship Diagram](https://www.mongodb.com/docs/compass/data-modeling/relationships.md#std-label-compass-data-modeling-relationships)

- [Export Your Entity-Relationship Diagram from Compass](https://www.mongodb.com/docs/compass/data-modeling/export-diagram.md#std-label-compass-data-modeling-export)

- [Import an Entity-Relationship Diagram in Compass](https://www.mongodb.com/docs/compass/data-modeling/import-diagram.md#std-label-compass-data-modeling-import)

## Learn More

- [Data Modeling in MongoDB](https://www.mongodb.com/docs/manual/data-modeling.md#std-label-manual-data-modeling-intro)

- [Data Modeling in MongoDB Compass](https://www.mongodb.com/docs/compass/data-modeling.md#std-label-compass-data-modeling)
