Skip to content

In this hands-on session, you’ll learn essential concepts such as using MongoTemplate for data access, implementing object mapping with Spring Data MongoDB, leveraging data repositories for CRUD operations, and harnessing the power of aggregation pipelines for advanced querying.

License

Notifications You must be signed in to change notification settings

mongodb-developer/mdb-java-workshop

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 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 Developer Hub.

MongoDB Cluster

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

Requirements

  • Java 21
  • Maven 3.8+

MongoDB URI

Add MongoDB Atlas Cluster URI in # src/main/resources/application.properties:

spring.data.mongodb.uri=mongodb+srv://<user>:<password>@<Cluster>/?retryWrites=true&w=majority

Command lines

  • Compile:
mvn clean compile
  • Run the Create class:
mvn spring-boot:run -Dspring-boot.run.arguments=create
  • Run the Read class:
mvn spring-boot:run -Dspring-boot.run.arguments=read
  • Run the Update class:
mvn spring-boot:run -Dspring-boot.run.arguments=update
  • Run the Delete class:
mvn spring-boot:run -Dspring-boot.run.arguments=delete
  • Run the MappingPOJO class:
mvn spring-boot:run -Dspring-boot.run.arguments=mapping

About

In this hands-on session, you’ll learn essential concepts such as using MongoTemplate for data access, implementing object mapping with Spring Data MongoDB, leveraging data repositories for CRUD operations, and harnessing the power of aggregation pipelines for advanced querying.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages