O'Reilly logo

MongoDB Cookbook - Second Edition by Amol Nayak, Cyrus Dasadia

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Connecting to a single node using a Java client

This recipe is about setting up the Java client for MongoDB. You will repeatedly refer to this recipe while working on others, so read it very carefully.

Getting ready

The following are the prerequisites for this recipe:

  • Java SDK 1.6 or above is recommended.
  • Use the latest version of Maven available. Version 3.3.3 was the latest at the time of writing this book.
  • MongoDB Java driver version 3.0.1 was the latest at the time of writing this book.
  • Connectivity to the Internet to access the online maven repository or a local repository. Alternatively, you may choose an appropriate local repository accessible to you from your computer.
  • The Mongo server is up and running on localhost and port 27017. Take a look ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required