Advertisement
joseleonweb

Untitled

May 4th, 2021
562
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.33 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 searchQuery = new BasicDBObject();
  5. searchQuery.put("name", "mkyong");
  6. DBCursor cursor = table.find(searchQuery);
  7. while (cursor.hasNext()) { System.out.println(cursor.next()); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement