O'Reilly logo

MongoDB Cookbook by Amol Nayak

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 from a Java client

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

Getting ready

The following are the prerequisites for this recipe:

  • Version 1.6 or above of Java SDK is recommended.
  • Use the latest available version of Maven. Version 3.1.1 was the latest at the time of writing this book.
  • Use the MongoDB Java driver. Version 2.11.3 was the latest at the time of writing this book.
  • Connectivity to the Internet to access the online Maven repository or a local repository is needed. Alternatively, you might choose an appropriate local repository accessible to you from your computer.
  • The Mongo server is up and running ...

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