Using the Java Driver in MongoDB
Using the Java Driver in MongoDB Environment: Ubuntu Linux 14.04 MongoDB 2.6.6 [installation how-to] Oracle JDK 7 [installation how-to] Maven 3.2.3 [installation how-to] Eclipse Luna 4.4.1 [installation how-to] The POM File The POM file contains this dependency: <dependency> <groupId>org.mongodb</groupId> <artifactId>mongo-java-driver</artifactId> <version>2.13.0-rc1</version> </dependency> Getting Started Navigate to the MongoDB project on Github here. This link will take you specifically to mongo-java-driver which is documented here. The sample code for the mongo-java-driver gives examples for performing CRUD operations against MongoDB in a Java environment. Specifically, the QuickTour.java file contains the examples we need to get up and running. When learning a new technique, I like to import sample code as a series of test cases to prove my environment. In this case, I have two VMs configured with Eclipse. On virtual...