Tip
For additional patterns and use cases, see also: Building with Patterns有关其他模式和用例,另请参见:使用模式构建
The following documents provide overviews of various data modeling patterns and common schema design considerations:以下文档概述了各种数据建模模式和常见的模式设计考虑因素:
Document Relationships文档关系Examples for modeling relationships between documents.文档间关系建模示例。Model One-to-One Relationships with Embedded Documents嵌入式文档的一对一关系模型Presents a data model that uses embedded documents to describe one-to-one relationships between connected data.展示了一个数据模型,该模型使用嵌入式文档来描述连接数据之间的一对一关系。Model One-to-Many Relationships with Embedded Documents与嵌入式文档的一对多关系模型Presents a data model that uses embedded documents to describe one-to-many relationships between connected data.提出了一种数据模型,该模型使用嵌入式文档来描述连接数据之间的一对多关系。Model Many-to-Many Relationships with Embedded Documents用嵌入式文档建模多对多关系Presents a data model that uses embedded documents to describe many-to-many relationships between connected data.提出了一种数据模型,该模型使用嵌入式文档来描述连接数据之间的多对多关系。Model One-to-Many Relationships with Document References模型一对多与文档引用的关系Presents a data model that uses references to describe one-to-many relationships between documents.展示了一个数据模型,该模型使用引用来描述文档之间的一对多关系。
Model Tree Structures模型树结构Examples for modeling tree structures.树结构建模示例。Model Tree Structures with Parent References具有父引用的模型树结构Presents a data model that organizes documents in a tree-like structure by storing references to "parent" nodes in "child" nodes.提出了一种数据模型,通过将对“父”节点的引用存储在“子”节点中,以树状结构组织文档。Model Tree Structures with Child References具有子引用的模型树结构Presents a data model that organizes documents in a tree-like structure by storing references to "child" nodes in "parent" nodes.提出了一种数据模型,通过将对“子”节点的引用存储在“父”节点中,以树状结构组织文档。
See Model Tree Structures for additional examples of data models for tree structures.有关树结构的数据模型的其他示例,请参阅模型树结构。Model Specific Application Contexts特定于模型的应用程序上下文Examples for models for specific application contexts.特定应用程序上下文的模型示例。Model Data for Atomic Operations原子操作的模型数据Illustrates how embedding fields related to an atomic update within the same document ensures that the fields are in sync.说明在同一文档中嵌入与原子更新相关的字段如何确保字段同步。Model Data to Support Keyword Search支持键搜索的模型数据Describes one method for supporting keyword search by storing keywords in an array in the same document as the text field. Combined with a multi-key index, this pattern can support application's keyword search operations.描述了一种通过将键存储在与文本字段相同的文档中的数组中来支持键搜索的方法。结合多键索引,此模式可以支持应用程序的键搜索操作。