Home > Software engineering >  Express not awaiting MongoJS Function
Express not awaiting MongoJS Function

Time:07-02

I've set up a function for my Express JS endpoint to 'await' to get a result from a Mongo DB using Mongo JS.

Function:-

async function getIntroducer(company){


  const intro = await dbIntro.collection('introducers').findOne({company: company},  function(err, doc) {
 
 console.log("           
  • Related