title: How to fix mongoose findOne returning empty when setting multidimensional array in map?
body: <p>How to fix mongoose findOne returning empty when setting multidimensional array in map?</p>
  
  <p>I've already tried to utilize a callback function, and I've heard about promises. I tried implementing the two but I'm having a difficult time. When I output console of user it gives me the user object, however after returning model.reviews it isn't defined.</p>
  
  <pre><code>  if(!_.isEmpty(model.reviews)){
  
      let result = model.reviews.map(async (item, index)=&gt;{
        console.log('item', item)
        console.log('model', model)
  
        let user = await User.findOne({ _id: item.user_id }).lean().exec((error, model)=&gt;{ if (error || !model) { return error } else { return model } })
        console.log('user', user)
  
        model.reviews[index].user = user
      })
    }
  
    return res.status(200).json({ status: 'success', response: 200, message: 'Found single model.', data: model });
  }
  </code></pre>
  
  <p>I expect to get model.reviews[index].user = USER, but model.reviews[index].user isn't defined in the returned model.reviews. </p>