We can’t have a blog without comments, so we’ll create a Comment model along association so that each article can have many comments. There are two ways to define associations with Mongoid. The first is through a reference association. This behaves in a similar way to the relations between tables in ActiveRecord and relational databases in that there are two separate records that are related through an id column. The other way is an embedded association which would mean in this case that the comments are embedded inside the same document as the article.