https://grokonez.com/spring-framework/spring-data/how-to-use-springdata-mongorepository-to-interact-with-mongdb-springboot-application

How to use SpringData MongoRepository to interact with MongoDB

How to use SpringData MongoRepository to interact with MongoDB

In the past post, we had learned how to work with MongoDB by MongoOperations which supports a set of standard APIs to manipulate data. So in the tutorial, JavaSampleApproach will show a powerful tool SpringData MongoRepository with flexible and more complex APIs to interact with MongoDB.

Related articles:

I. Technologies

– Java: 1.8 – Maven: 3.3.9 – Spring Tool Suite: Version 3.8.4.RELEASE – Spring Boot: 1.5.4.RELEASE - MongoDB: v3.4.1

I. MongoRepository

MongoRepository is implemented with lots of APIs to store and retrieve data. We can use MongoRepository with full generic CRUD operations of CrudRepository interface, and additional methods of PagingAndSortingRepository interface for pagination and sorting. MongoRepository also extends QueryByExampleExecutor so it allows execution of Query by Example.

public interface MongoRepository
		extends PagingAndSortingRepository, QueryByExampleExecutor {
...


public interface PagingAndSortingRepository extends CrudRepository {

-> With a strong set of APIs, We should start Spring MongoRepository to manipulate data from MongoDB.

SpringData Mongodb - architectures c

II. Practice

More at:

https://grokonez.com/spring-framework/spring-data/how-to-use-springdata-mongorepository-to-interact-with-mongdb-springboot-application

#mongodb #springdata #springboot

How to use SpringData MongoRepository to interact with MongoDB » grokonez
1.25 GEEK