Entity Relationship Diagram (ERD)
Visualize your MongoDB database schema with an interactive Entity Relationship Diagram showing collections and their fields.
Getting Startedโ
Connect to your MongoDB database and select a database. The ERD automatically generates a visual representation of all collections and their field structures.
ERD Featuresโ
Collection Nodesโ
Each collection is displayed as a node:
- Collection name as header
- Field list with types
- Document count badge
- Click to select
Field Informationโ
See field names and types for each collection:
- Field name
- Inferred data type
- Required/optional indicator
- Nested object indicator
Document Countsโ
View approximate document counts per collection:
- Shown on collection node
- Helps identify large/small collections
- Updates on refresh
Interactive Layoutโ
Drag nodes to reorganize the diagram:
- Click and drag collection nodes
- Arrange for best visibility
- Layout persists during session
Zoom and Panโ
Navigate large schemas easily:
- Scroll to zoom in/out
- Click and drag background to pan
- Fit all button to view entire diagram
Schema Analysisโ
The ERD analyzes sample documents from each collection to infer field types and structures:
Field Type Detectionโ
- String, Number, Boolean, Date
- ObjectId (potential references)
- Array (with element types)
- Nested Object (with sub-fields)
Nested Structuresโ
Nested objects and arrays are represented in the field list:
address: Object
โโโ street: String
โโโ city: String
โโโ zip: String
tags: Array<String>
Reference Detectionโ
Potential relationships between collections:
- ObjectId fields that may reference other collections
- Field names suggesting relationships (userId, orderId)
- Matching patterns across collections
Using the ERDโ
Understand Database Structureโ
Before building forms:
- See all collections at a glance
- Understand data organization
- Identify main entities
Identify Relationshipsโ
Find connections between collections:
- Foreign key patterns
- Reference fields
- Join opportunities
Discover Available Fieldsโ
Before building forms:
- See all fields in a collection
- Understand field types
- Plan form field mappings
The ERD updates automatically when you change databases. Use it as a reference when configuring lookup fields in your forms.
ERD Controlsโ
Refreshโ
Reload schema from database:
- Gets latest structure
- Updates document counts
- Refreshes field types
Zoom Controlsโ
- Zoom In (+) - Closer view
- Zoom Out (-) - Wider view
- Fit All - Show entire diagram
- Reset - Default zoom level
Layout Optionsโ
- Auto Layout - Arrange nodes automatically
- Horizontal - Left-to-right layout
- Vertical - Top-to-bottom layout
Filterโ
Filter visible collections:
- Search by name
- Show/hide specific collections
- Focus on relevant tables
Collection Detailsโ
Click on a collection to see details:
Statisticsโ
- Document count
- Average document size
- Index information
- Storage size
Schemaโ
- All fields detected
- Type distribution
- Optional/required fields
- Nested structure
Sample Dataโ
- View sample documents
- See actual values
- Understand data patterns
Export Optionsโ
Export Imageโ
Save ERD as an image:
- PNG format
- High resolution
- Include/exclude details
Export Schemaโ
Export schema as JSON:
{
"collections": {
"users": {
"fields": {
"name": "String",
"email": "String",
"createdAt": "Date"
}
}
}
}
Best Practicesโ
- Refresh regularly - Schema may change
- Note relationships - Track foreign keys
- Document discoveries - Note unexpected structures
- Use for planning - Before building forms
- Share with team - Export for documentation
Limitationsโ
Sampling-Basedโ
Schema is inferred from samples:
- May miss rare fields
- Types based on observed values
- Refresh for better coverage
No Enforced Relationshipsโ
MongoDB doesn't enforce relationships:
- ERD shows inferred connections
- Verify relationships manually
- Reference patterns may vary
Next Stepsโ
- Form Builder - Create data entry forms
- Browsing Data - Browse collection data
- Data Explorer Overview - Learn more about Data Explorer