Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Post.find().then(posts=> {
- async.forEach(posts, function(post, done) {
- Cat.find().where('posts').in([post.id]).then(categories=> {
- post.categories = categories;
- var id=mongoose.Types.ObjectId(post.id);
- File.findOne({'related.ref': id}).then(pic=>{
- post.pic=pic;
- });
- })
- //res.send(posts);????
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement