Docs 菜单

数据模型示例和模式

另请参阅:

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:

文档之间的关系

Examples for modeling relationships between documents.

使用嵌入式文档建立一对一关系模型
Presents a data model that uses embedded documents to describe one-to-one relationships between connected data.
使用嵌入式文档建立一对多关系模型
Presents a data model that uses embedded documents to describe one-to-many relationships between connected data.
使用嵌入式文档建立多对多关系模型
Presents a data model that uses embedded documents to describe many-to-many relationships between connected data.
使用文档引用建立一对多关系模型
Presents a data model that uses references to describe one-to-many relationships between documents.
对树结构进行建模

Examples for modeling tree structures.

使用父引用对树结构进行建模
Presents a data model that organizes documents in a tree-like structure by storing references to "parent" nodes in "child" nodes.
使用子引用对树结构进行建模
Presents a data model that organizes documents in a tree-like structure by storing references to "child" nodes in "parent" nodes.

See 对树结构进行建模 for additional examples of data models for tree structures.

对特定应用程序上下文进行建模

Examples for models for specific application contexts.

对原子操作的数据进行建模
说明了如何将与原子更新相关的字段嵌入到同一文档中,以确保这些字段保持同步。
对数据进行建模以支持关键字搜索
描述了一种通过将关键字存储于文本字段所在文档的数组中,以支持关键字搜索的方法。结合多键索引,此模式可以支持应用程序的关键字搜索操作。