{"id":14956972,"url":"https://github.com/leonardodalcin/mongo-auto-erd","last_synced_at":"2025-10-24T10:31:16.904Z","repository":{"id":36364995,"uuid":"214734647","full_name":"leonardodalcin/mongo-auto-erd","owner":"leonardodalcin","description":"Generates a .png ERD of a mongo database through a CLI","archived":false,"fork":false,"pushed_at":"2023-01-05T01:01:04.000Z","size":2894,"stargazers_count":20,"open_issues_count":8,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-29T10:22:55.029Z","etag":null,"topics":["diagram","entity","erd","generator","mongo-auto-erd","relationship"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/leonardodalcin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-10-13T00:13:53.000Z","updated_at":"2024-10-07T15:38:39.000Z","dependencies_parsed_at":"2023-01-17T00:49:40.594Z","dependency_job_id":null,"html_url":"https://github.com/leonardodalcin/mongo-auto-erd","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardodalcin%2Fmongo-auto-erd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardodalcin%2Fmongo-auto-erd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardodalcin%2Fmongo-auto-erd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonardodalcin%2Fmongo-auto-erd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonardodalcin","download_url":"https://codeload.github.com/leonardodalcin/mongo-auto-erd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":237950925,"owners_count":19392667,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["diagram","entity","erd","generator","mongo-auto-erd","relationship"],"created_at":"2024-09-24T13:13:48.764Z","updated_at":"2025-10-24T10:31:11.504Z","avatar_url":"https://github.com/leonardodalcin.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Test Coverage](https://api.codeclimate.com/v1/badges/16064394f798d92ffc0f/test_coverage)](https://codeclimate.com/github/leonardodalcin/mongo-auto-erd/test_coverage)\n\u003ca href=\"https://twitter.com/acdlite/status/974390255393505280\"\u003e\n\u003cimg alt=\"Blazing Fast\" src=\"https://img.shields.io/badge/speed-blazing%20%F0%9F%94%A5-brightgreen.svg?style=flat-square\"\u003e\u003c/a\u003e\n\n# mongo-auto-erd\n\nThis is an Entity Relationship Diagram generator for MongoDB databases. Given a connection url, it performs reverse engineering by map reducing db collections into a well defined interface with properties and it's relationships.\n\n## Caveats\n\nThis lib will only generate `.svg`, `.png` and `.dot` formats if `graphviz` is installed. Graphviz is a quasi\nstandart library to generate `graphs`, their creators proposed the `.dot` language for graph representations, I\nopted to use\nit because it is\ncompatible or\nconvertible to many graph editing platforms.\n\nIf you don't want to use `graphviz`, the software will output a well defined ERD interface:\n\n```typescript\nexport interface IEntity {\n  name: string\n  properties: IProperty[]\n  relationships: IRelationship[]\n}\n\nexport interface IProperty extends IMapReducedProperty {\n  types: IPropertyType[]\n}\n\nexport type IPropertyType =\n  | 'string'\n  | 'undefined'\n  | 'null'\n  | 'number'\n  | 'objectId'\n  | 'boolean'\n  | 'unknown'\n  | 'array'\n  | 'function'\n  | 'symbol'\n  | 'bigint'\n  | 'object'\n\nexport interface IRelationship {\n  propertyNames: string[]\n  targetCollectionName: string\n}\n\nexport interface IMapReducedProperty {\n  name: string\n  values: any[]\n}\n```\n[Example .json output](erd.json)\n\n## Usage\n\n`mongo-erd --uri mongodb://127.0.0.1:27017 --db dbname --outfile ./erd`\n\nThis command will produce a result like\n\n\n![Example .png diagram](erd.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardodalcin%2Fmongo-auto-erd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonardodalcin%2Fmongo-auto-erd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonardodalcin%2Fmongo-auto-erd/lists"}