首页 > 其他 > 详细

Mongoid Relationships

时间:2019-04-30 11:27:58      阅读:128      评论:0      收藏:0      [点我收藏+]

1:1 embedded relationship: 

技术分享图片

 

M:1 linked relationship(one_direction): 

child uses belongs_to 

parent uses has_many 

 

1:M embedded relationship: 

技术分享图片

 

M:1 embedded relationship:

 

技术分享图片

 

技术分享图片

*annotated link 

*"1" side has a primary key and typically has no reference to the child within the document 

*"M" side will typically host the foreign key

 

1:1 Linked relationship - has_one:

child belongs_to 

parents has_one 

 

M:M Linked Relationship 

has_and_belongs_to_many 

技术分享图片

 

Mongoid Relationships

原文:https://www.cnblogs.com/vixennn/p/10794826.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!