Built-in collections simplify the work with the database (reduce the number of collections) and speed up the database. Usually I try to implement everything, and only if I cannot create separate collections. If your inline collection is large, you can exclude it from the user at boot time:
db.posts.find( { tags : 'tennis' }, { comments : 0 } );
Above the request will upload messages without comment. Documentation
But inline collections also add some complexity. For example, mongodb cannot sort the built-in collection for you. Ordering is always the default. But you can do it on the client side. If the default order works for you, you can insert a nested collection through $ slice:
db.posts.find({}, {comments:{$slice: [20, 10]}}) // skip 20, limit 10
Also check out the doc schema description.
So + 1 for implementation when possible.
Andrew Orsich
source share