MongoDB is a document-oriented NoSQL database. It stores documents in BSON, or Binary JSON, which can be queried and retrieved in ways broadly similar to other databases. section 4.0 section 4.2
A Spring application typically connects MongoDB through Spring Data:
- Add the nonreactive Spring Data MongoDB starter to the project build; Spring Boot autoconfiguration then enables automatic repository interfaces. section 4.2.1
- Annotate domain classes so their types map to MongoDB document structures, then define repository interfaces using the familiar Spring Data programming model. section 4.2
- Run MongoDB locally on its default port, use an embedded database for development and testing, or configure production connection properties. section 4.2.1
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>
spring-boot-starter-data-mongodb
</artifactId>
</dependency>
Use the starter dependency as the minimal build configuration for enabling Spring Data MongoDB. section 4.2.1






