Skip to content

Latest commit

 

History

History
21 lines (15 loc) · 644 Bytes

README.md

File metadata and controls

21 lines (15 loc) · 644 Bytes

spring-boot-mongodb

MongoDB can connect to Spring Boot in two ways:

  • the MongoRepository interface
  • the MongoTemplate class.

MongoRepository extends the CrudRepository interface that contains methods to perform basic CRUD operations.

For writing custom queries and aggregations, and for a finer control over query filters, we can use the MongoTemplate class. MongoTemplate class implements interfaces that support operations like

  • aggregation
  • find
  • update
  • upsert
  • index
  • remove

and more.