title: how can insert data into mongodb from android app?
body: <p>I want to insert my json data into mongo database, i import mongo Driver v 3.2.2 and create a database , collection in mlab.com but i cant send data in database such an document.</p>
  
  <p>this is my code :</p>
  
  <pre><code>try {
      MongoClientURI uri  = new MongoClientURI("mongodb://user:pass@ds041939.mlab.com:41939/vado");
      MongoClient client = new MongoClient(uri);
      DB db = client.getDB(uri.getDatabase());
      DBCollection collection = db.getCollection("salam");
  
      DBObject dbObject = (DBObject) JSON.parse("{'name':'mkyong', 'age':30}");
  
  
      collection.insert(dbObject);
  
      DBCursor cursorDoc = collection.find();
      while (cursorDoc.hasNext()) {
      System.out.println(cursorDoc.next());
      }
  } catch (Exception e) {
      e.printStackTrace();
  }
  </code></pre>