Yes, this is a problem if comments grow by more than 4 MB. You can change your desgin a bit with mongo DbRef .
split your document into two in the form of a blog and comments
var comment = { id:"xx", comments : [ { author: 'jim', comment: 'I disagree' }, { author: 'nancy', comment: 'Good post' } ]} }
This comment document will contain all comments related to a specific post. And embed these comments on your blog using Dbref, something like
db.comments.save(comment) var doc = { author: 'joe', created : new Date('03/28/2009'), title : 'Yet another blog post', text : 'Here is the text...', tags : [ 'example', 'joe' ], comments : [ new DBRef('comments', comment ._id) ] } db.blog.save(doc)
source share