Mongoose / MongoDB schemas for blog posts and authors
You can use the forEach function like this

const allPosts = [];

Author.find({}, function(err, users) {
    if (err) throw err;

    users.forEach(function(user) {
        const a = user.posts;
        a.forEach(us =&gt; allPosts.push(us));
    });
});


Now the allPosts array will have all the posts.