title: How to convert callback code to async/await?
body: <p>I am working with <strong>Mongoose ODM</strong> for <strong>MongoDB</strong> in a node express-based web application which provides its API in a callback fashion. This fashion creates a callback hell to populate documents.</p>
  
  <p>Edit 1: I have added the current working code.</p>
  
  <pre><code>User.remove({}, (err) =&gt; {
    if (err) return console.error(err)
  
    let admin = new User({
      email: 'admin@dap.com',
      password: 'dapdap'
    })
  
    admin.save((err, admin) =&gt; {
      if (err) return console.error(err)
  
      console.info('Success')
      mongoose.disconnect()
    })
  
  })
  </code></pre>
  
  <p>Is there an elegant way to convert the callbacks into async/await fashion in javascript in general? And in mongoose environment?</p>