Skip to content

Ancy1987/java-quick-start

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java Quick Start Project

This repository contains code samples for the Quick Start blog post series.

You can read more about the Quick Start series on the MongoDB blog Quick Start section.

MongoDB Cluster

To get started with MongoDB Atlas and get a free cluster read this blog post.

Requirements

  • Java JDK 8 to 13.
  • Maven 3.6.2.

Command lines

  • Compile:
mvn clean compile
  • Run the HelloMongoDB class:
mvn compile exec:java -Dexec.mainClass="com.mongodb.quickstart.HelloMongoDB"
  • Run the Connection class:
mvn compile exec:java -Dexec.mainClass="com.mongodb.quickstart.Connection" -Dmongodb.uri=mongodb+srv://USERNAME:PASSWORD@cluster0-abcde.mongodb.net/test?w=majority
  • Run the Create class:
mvn compile exec:java -Dexec.mainClass="com.mongodb.quickstart.Create" -Dmongodb.uri=mongodb+srv://USERNAME:PASSWORD@cluster0-abcde.mongodb.net/test?w=majority
  • Run the Read class:
mvn compile exec:java -Dexec.mainClass="com.mongodb.quickstart.Read" -Dmongodb.uri=mongodb+srv://USERNAME:PASSWORD@cluster0-abcde.mongodb.net/test?w=majority

Author

Maxime Beugnet maxime@mongodb.com

About

This repository contains code samples for the Java Quick Start blog post series

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%