Reverse Engineer MongoDB Walkthrough

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to MongoDB Support

To reverse engineer your MongoDB database, please follow the steps below.

The links built into the text are hyperlinks to other areas in this wiki that can give you further information about the text that is highlighted. Should you wish to return to these instructions, click the Back button on your browser.


  1. Install ER/Studio Data Architect.
  2. Choose File > New and select reverse-engineer from the popup window.
  3. Click Login.
    Newdb.png
  4. On the following window, choose the type of connection you would like. For MongoDB select Native Connection and choose MongoDB from the dropdown list.
    Wizard pg1.png
  5. Enter your MongoDB URI or click Advanced Options to manually enter connection and authentication information. In our example we are using the server IP address (10.150.40.240) and the default admin account which we entered the username and password in the Advanced Options section.
  6. Click Next to connect to the MongoDB server.
  7. Now you have authenticated and connected to the MongoDB server, you can select, or type in the name of the database you would like to reverse engineer.
    Wizard pg2.png
    • To choose from a list, click the [...] button to the right of the Database List. In our example we are using the library database.
    Wizard DB Select.png
  8. Click Next.
  9. Select the tables or collections you would like to reverse engineer.
    Wizard pg3.png
  10. Click Next.
  11. On Page 4 you can choose the desired layout. This can be changed again at a later time from within the model explorer, using the layout menu.
    Wizard pg4.png
  12. Page 5 allows you to set the type of physical model, any external naming standards, and a summary of the selected objects.
    Wizard pg5.png
  13. Click Finish to complete the wizard.
  14. ER/Studio Data Architect separates the logical data model from the physical representation for a specific DBMS. After the reverse engineering, the logical model is shown. Click on the Physical model node in the tree to see the Physical model of the reverse engineered.
    Finalmodel.png
  15. Collections are indicated by square corners. All collections have an _id field. Nested objects are indicated by rounded corners.
    Nested.png
    Containment relationship lines show how nested objects are used by collections. The diamond endpoint connects to the parent object and the other end connects to the nested object. Containment relationships can contain one or many which are signified by a 1 or * at the end of the relationship.
  16. Add Collections to your model by selecting the Add Collection tool and dropping them in.
    Add collection.png
  17. Add nested objects to your model by selecting the Add Nested Object tool and dropping them in. If you have a collection or other nested object selected before using the nested object tool, then a containment relationship will automatically be created from that selected object.
    Add nested.png
    You can double-click on any object to edit, add, modify, or remove fields.
  18. Open the Collection Editor by double-clicking an object.
    Collection editor.png
    From here, you are able to set field names and datatypes, as well as other informational data, such as a definition.
    You can also mark fields as Arrays by checking the Array option in the field editor.
    Array.png

Magic Wand Icon.pngTip: Go to diagram and object display options and check the Datatype option under Table to show the data types of your fields in the model.

Datatype.png

See Also