嵌入文档家长协会如果我有:使用MongoMapper
class Post
include MongoMapper::Document
has_many :comments
end
如果我做的:
class Comment
include MongoMapper::EmbeddedDocument
belongs_to :post # relevant part
end
这是否创建一个使用_root_document
/_parent_document
的关联,还是我来添加(多余)key :post_id
?