嵌入文檔家長協會如果我有:使用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
?