You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 18, 2024. It is now read-only.
Repository to help getting started with MongoDB Java driver connecting to MongoDB Atlas
1
+
# Quickstart Java
2
+
3
+
Repository to help getting started with MongoDB Java driver connecting to MongoDB Atlas.
4
+
5
+
## Information
6
+
7
+
This Quickstart project uses [MongoDB Java driver](https://mongodb.github.io/mongo-java-driver/) version 3.11.1 by default. Although you can change the driver version, the provided code example was only tested against the default version of MongoDB driver. There is no guarantee that the code sample will work for all possible versions of the driver.
8
+
9
+
## Pre-requisites
10
+
11
+
### Docker
12
+
13
+
Have Docker running on your machine. You can download and install from: https://docs.docker.com/install/
14
+
15
+
### MongoDB Atlas
16
+
17
+
In order to execute the code example, you need to specify `MONGODB_URI` environment variable to connect to a MongoDB cluster. If you don't have any you can create one by signing up [MongoDB Atlas Free-tier M0](https://docs.atlas.mongodb.com/getting-started/).
18
+
19
+
## Build Steps
20
+
21
+
1. Build Docker image with a tag name. Within this directory execute:
22
+
* To use the default driver version and specify `MONGODB_URI`:
### Change driver version from within the Docker environment
48
+
49
+
You can change the version of `mongo-driver-sync` before code compilation time by modifying the [pom.xml: mongo-java-driver version](java/pom.xml#L11).
50
+
51
+
From within the docker environment, you can also change the `MONGODB_URI` by changing the environment variable:
0 commit comments