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

# Export Your Entity-Relationship Diagram from Compass

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 share your refactored data model with other teams to receive feedback and align on final schema design decisions. To share your refactored schema, you can export your entity-relationship diagram from Compass.

## About this Task

You can export your entity-relationship diagram as a:

- Diagram File.

- PNG image.

- JSON file.

When you export your diagram as a Diagram File, Compass exports the diagram as a `.mdm` file. This file format allows you to import the diagram into Compass, which can be helpful when sharing your entity-relationship diagram with collaborators in the Compass or MongoDB Atlas data modeling experience.

When you export your diagram as a PNG image, Compass exports the collections and their relationships as they appear in the Data Modeling tab. This format helps you share a visual representation of your schema in documentation or presentations.

When you export your diagram as a JSON file, it includes:

- A `collections` array with the collection namespaces and their [`jsonSchema`.](https://www.mongodb.com/docs/manual/reference/operator/query/jsonSchema.md#mongodb-query-op.-jsonSchema)

- A `relationships` array with the namespaces of the related collections and their linked fields.

## Before You Begin

Before you export your schema visualization, ensure you already [generated a diagram.](https://www.mongodb.com/docs/compass/data-modeling.md#std-label-compass-data-modeling)

## Steps

1. Open the Data Modeling tab

   In the left sidebar, click  Data Modeling.

2. Open your entity-relationship diagram

3. Open the Export data model modal

   In the upper-right corner of your diagram view, click the  icon.

4. Select your export file format

   After you select the file format, click Export.

5. Save your exported file

   Select the location on your filesystem to save your exported file.

## Learn More

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

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