码迷,mamicode.com
首页 > 数据库 > 详细

MongoDB 学习笔记2

时间:2015-10-10 17:21:00      阅读:205      评论:0      收藏:0      [点我收藏+]

标签:

文档模型关系

Model One-to-One Relationships with Embedded Documents

Overview

Data in MongoDB has a flexible schema. Collections do not enfoce document structure.

Pattern

In the normalized data model, the address document contains a reference to the patron document.

技术分享
If the address data is frequently retrivevd with name information, then with referencing, your application needs to issue multiple queries to resolve the reference. The better data model would to be embed the address data in the patron data, as in the following document:

技术分享

 

Model One-to-Many Relationships with Embedded Documents


Overview

Pattern

Model one-to-Many Relationships with Document References

Overview

Pattern

MongoDB 学习笔记2

标签:

原文地址:http://www.cnblogs.com/hotbaby/p/4867452.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!