Awesome Open Source
Awesome Open Source

Spring Data JPA MongoDB Expressions

Java CI with Maven codecov javadoc Join the chat at Tweet

How it works:

  1. Customize JPA Repository base class:
@EnableJpaRepositories(repositoryBaseClass = ExpressionsRepositoryImpl.class)
public class Application { … }
  1. Change your repository to extends ExpressionsRepository:
public interface EmployeeRepository extends ExpressionsRepository<Employee, Long> {
  1. Build the controller/service:
public ResponseEntity<Page<EmployeeDto>> search(@RequestBody Expressions expressions, Pageable pageable) {
    return ok().body(
                employeeRepository.findAll(expressions, pageable).map(employeeMapper::toDto)
  1. Send Mongodb query in JSON from frontend:


    Learn more

    For quick start see this Medium post or post or see this demo example on Github.

    See documentation website for details about how to get started.



    🎖 Special Thanks

    Special thanks to Rashad Saif and Hamada Elnoby for helping in the design, inspring with ideas, and for doing code review.

    Next Release

    See List of issues to be shipped in the next release

    In the News

    This repo has mentioned in weekly news.

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Java (697,184
Mongodb (14,619
Spring Boot (12,437
Hibernate (1,247
Jpa (1,096
Spring Data Jpa (1,034
Related Projects