Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

mhewedy/spring-data-jpa-mongodb-expressions

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Data JPA MongoDB Expressions

Java CI with Maven codecov javadoc Join the chat at https://gitter.im/spring-data-jpa-mongodb-expressions/community Tweet

How it works:

  1. Customize JPA Repository base class:
@SpringBootApplication
@EnableJpaRepositories(repositoryBaseClass = ExpressionsRepositoryImpl.class)
public class Application { … }
  1. Change your repository to extends ExpressionsRepository:
@Repository
public interface EmployeeRepository extends ExpressionsRepository<Employee, Long> {
}
  1. Build the controller/service:
@PostMapping("/search")
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:

    image

    Learn more

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

    See documentation website for details about how to get started.

    Install:

    <dependency>
      <groupId>com.github.mhewedy</groupId>
      <artifactId>spring-data-jpa-mongodb-expressions</artifactId>
      <version>0.0.5</version>
    </dependency>
    

    🎖 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 spring.io weekly news.

About

Use the MongoDB query language to query your relational database, typically from frontend.

Topics

Resources

License

Stars

Watchers

Forks

Contributors 2

  •  
  •  

Languages

Morty Proxy This is a proxified and sanitized view of the page, visit original site.