The data modeling experience in Compass allows you to create an entity-relationship diagram that visualizes collections, their fields, data types, and their relationships within a single database. Compass中的数据建模体验允许您创建一个实体关系图,在单个数据库中可视化集合、其字段、数据类型及其关系。With this, you can better understand how your data is structured and connected, making it easier to develop applications, collaborate with team members, and maintain evolving data models.通过这种方式,您可以更好地了解数据的结构和连接方式,从而更容易开发应用程序、与团队成员协作以及维护不断发展的数据模型。
Use Cases用例
The data modeling experience in Compass can be useful in the following scenarios:Compass中的数据建模经验在以下场景中非常有用:
Data visualization数据可视化: Generate an entity-relationship diagram of your current data model. Visualizing your data model can help you identify impacts of potential schema changes across related collections.:生成当前数据模型的实体关系图。可视化数据模型可以帮助您识别相关集合中潜在模式更改的影响。Data model planning数据模型规划: Track and plan changes to your data structure as your application grows. Visualizing your data model can help you identify potential impacts of schema changes across related collections.:随着应用程序的增长,跟踪和计划数据结构的更改。可视化数据模型可以帮助您识别相关集合中模式更改的潜在影响。Cross-team collaboration跨团队协作: Share visual representations of your data model with data engineers, product managers, and other stakeholders to ensure everyone understands the current state of your database structure. You can share your data model as an image, JSON file, or:与数据工程师、产品经理和其他利益相关者共享数据模型的可视化表示,以确保每个人都了解数据库结构的当前状态。您可以将数据模型作为图像、JSON文件或.mdmfile that can be opened directly in Compass..mdm文件共享,这些文件可以直接在Compass中打开。Application development应用程序开发: Identify inconsistencies, missing relationships, or optimization opportunities in your data model during the development process.:在开发过程中识别数据模型中的不一致、缺失的关系或优化机会。Team member onboarding团队成员入职培训: Quickly understand existing data models when onboarding onto a new project or working with collections created by other teams.:在加入新项目或使用其他团队创建的集合时,快速了解现有的数据模型。
Behavior行为
Compass generates an entity-relationship diagram based on a small sample of documents from each collection you select in your database. Due to this sampling, your diagram might not reflect all fields or relationships in your data.Compass基于您在数据库中选择的每个集合中的一小部分文档样本生成实体关系图。由于此采样,图表可能无法反映数据中的所有字段或关系。
Get Started开始使用
Details详情
Annotations注释
You can add comments to your diagram's collections, fields, and relationships to document definitions or data modeling decision.您可以向图表的集合、字段和关系添加注释,以记录定义或数据建模决策。
Relationships关系
You can define relationships between fields in different collections in your entity-relationship diagram. 您可以在实体关系图中定义不同集合中的字段之间的关系。When you create an entity-relationship diagram, you can opt for Compass to automatically infer relationships. 创建实体关系图时,可以选择Compass自动推断关系。You can also manually add relationships.您还可以手动添加关系。
Note
Relationships are for annotation purposes only. Compass does not store relationship information in your MongoDB database.关系仅用于注释目的。Compass不会将关系信息存储在MongoDB数据库中。
Sharing Diagrams共享图表
You can export your Compass entity-relationship diagram. 您可以导出Compass实体关系图。By sharing your diagram, you can collaborate with various teams, receive feedback, and align on final schema design decisions.通过共享图表,您可以与各个团队协作,接收反馈,并就最终的模式设计决策达成一致。
You can export your diagram as a:您可以将图表导出为:
.mdmDiagram File.图表文件。.pngimage.图像。.jsonfile.文件。
You can also import Compass an entity-relationship diagram that was exported as a 您还可以导入Compass,这是一个导出为.mdm file. .mdm文件的实体关系图。By importing an entity-relationship diagram, you can view or edit a diagram shared by a collaborator.通过导入实体关系图,您可以查看或编辑合作者共享的关系图。