title: save password as salted hash in mongodb in users collection using python/bcrypt
body: <p>I want to generate a salted password hash and store it in MongoDB collection called users, like this:</p>
  
  <pre><code>users_doc = { 
      "username": "James",
      "password": "&lt;salted_hash_password&gt;"
  }
  </code></pre>
  
  <p>I'm not sure how to generate the hashed password using Bcrypt, then when I login in my flask app, be able to check if the hash matches with the hashed password stored in MongoDB.</p>