@@ -0,0 +1,779 @@
+package tastingwine;%0A%0Aimport org.bson.Document;%0A%0Aimport com.mongodb.BasicDBObject;%0Aimport com.mongodb.DB;%0Aimport com.mongodb.DBCollection;%0Aimport com.mongodb.DBObject;%0Aimport com.mongodb.MongoClient;%0Aimport com.mongodb.MongoException;%0Aimport com.mongodb.client.MongoDatabase;%0A%0Apublic class mongodbtest %7B%0A%0A%09@SuppressWarnings(%22deprecation%22)%0A%09public static void main(String%5B%5D args) %7B%0A%09%09System.out.println(%22Going to open mongoDB Connection....%22);%0A%09%09MongoClient mongoClient = new MongoClient(%22localhost%22, 27017);%0A%09%09DB db = mongoClient.getDB(%22mongodbtest%22);%0A%09%09DBCollection wishlistcollection = db.getCollection(%22wishlist%22);%0A%09%09DBObject document = new BasicDBObject();%0A%09%09document.put(%22personID%22, %22person1%22);%0A%09%09document.put(%22wineID%22, %22wine1%22);%0A%09%09wishlistcollection.insert(document);%0A%09%7D%0A%7D%0A

Create mongodbtest.java