Data Model Examples and Patterns数据模型示例和模式

Building with Patterns Blog Series用模式构建博客系列

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:以下文档概述了各种数据建模模式和常见的模式设计注意事项:

Model Relationships Between Documents文档之间的模型关系

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 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.结合多键索引,此模式可以支持应用程序的关键字搜索操作。