Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MongoClient mongo = new MongoClient("localhost", 27017);
- DB db = mongo.getDB("lamevabbdd");
- DBCollection table = db.getCollection("persona");
- BasicDBObject searchQuery = new BasicDBObject();
- searchQuery.put("name", "mkyong");
- DBCursor cursor = table.find(searchQuery);
- while (cursor.hasNext()) { System.out.println(cursor.next()); }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement