Thursday 21 February 2019

How can I execute different multiple queries in using mongoose?

Currently I'm building a blog and on single post page I also need to show recent posts. To get single post by id I usedblogPost.findById(id).then((doc) => {Now I also want to executeblogPost.find().then((doc)=>{in order to get 5 recent posts. Can someone tell how how can I execute more than 1 queries in single client request?

Submitted February 22, 2019 at 03:57AM by pverma8172

No comments:

Post a Comment