title: Encrypt password fields in mongodb
body: <p>I have following code, it insert the <code>userName</code> and <code>password</code> into database
  but the password is stored in plain text format. I mean when I'll look into the db I can see the inserted password. </p>
  
  <p>I want to store <code>password</code> in <code>encrypted</code> format</p>
  
  <pre><code>MongoClient client = new MongoClient("localhost",27017);
  DB db = client.getDB("Test");
  DBCollection collection = db.getCollection("EncryptionDemo"); 
  BasicDBObject documentDetail = new BasicDBObject();
  documentDetail.put("userName", "admin12");
  documentDetail.put("password", "12345");
  collection.insert(documentDetail);
  </code></pre>
  
  <p>How can I achieve this?</p>