Advertisement
joseleonweb

Untitled

May 4th, 2021
754
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.31 KB | None | 0 0
  1. MongoClient mongo = new MongoClient("localhost", 27017);
  2. DB db = mongo.getDB("lamevabbdd");
  3. DBCollection table = db.getCollection("persona");
  4. BasicDBObject document = new BasicDBObject();
  5. document.put("name", "mkyong");
  6. document.put("age", 30);
  7. document.put("createdDate", new Date());
  8. table.insert(document);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement