ProductPromotion
Logo

Java

made by https://0x3d.site

GitHub - mhewedy/spring-data-jpa-mongodb-expressions: Use the MongoDB query language to query your relational database, typically from frontend.
Use the MongoDB query language to query your relational database, typically from frontend. - mhewedy/spring-data-jpa-mongodb-expressions
Visit Site

GitHub - mhewedy/spring-data-jpa-mongodb-expressions: Use the MongoDB query language to query your relational database, typically from frontend.

GitHub - mhewedy/spring-data-jpa-mongodb-expressions: Use the MongoDB query language to query your relational database, typically from frontend.

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 { … }
    
  2. Change your repository to extend ExpressionsRepository:
    @Repository
    public interface EmployeeRepository extends ExpressionsRepository<Employee, Long> {
    }
    
  3. 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)
            );
    }
    
  4. Send Mongodb query in JSON from frontend:
    {
      "$or": [
        {"lastName": "ibrahim"},
        {
          "$and": [
            {"firstName": "mostafa"},
            {"birthDate": {"$gt": "1990-01-01"}}
          ]
        }
      ]
    }
    

Learn more

For a 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:

For spring-boot 3.x:

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

For spring-boot 2.x:

<dependency>
  <groupId>com.github.mhewedy</groupId>
  <artifactId>spring-data-jpa-mongodb-expressions</artifactId>
  <version>0.0.8</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.

In the News

This repo has been mentioned in spring.io weekly news.

More Resources
to explore the angular.

mail [email protected] to add your project or resources here 🔥.

Related Articles
to learn about angular.

FAQ's
to learn more about Angular JS.

mail [email protected] to add more queries here 🔍.

More Sites
to check out once you're finished browsing here.

0x3d
https://www.0x3d.site/
0x3d is designed for aggregating information.
NodeJS
https://nodejs.0x3d.site/
NodeJS Online Directory
Cross Platform
https://cross-platform.0x3d.site/
Cross Platform Online Directory
Open Source
https://open-source.0x3d.site/
Open Source Online Directory
Analytics
https://analytics.0x3d.site/
Analytics Online Directory
JavaScript
https://javascript.0x3d.site/
JavaScript Online Directory
GoLang
https://golang.0x3d.site/
GoLang Online Directory
Python
https://python.0x3d.site/
Python Online Directory
Swift
https://swift.0x3d.site/
Swift Online Directory
Rust
https://rust.0x3d.site/
Rust Online Directory
Scala
https://scala.0x3d.site/
Scala Online Directory
Ruby
https://ruby.0x3d.site/
Ruby Online Directory
Clojure
https://clojure.0x3d.site/
Clojure Online Directory
Elixir
https://elixir.0x3d.site/
Elixir Online Directory
Elm
https://elm.0x3d.site/
Elm Online Directory
Lua
https://lua.0x3d.site/
Lua Online Directory
C Programming
https://c-programming.0x3d.site/
C Programming Online Directory
C++ Programming
https://cpp-programming.0x3d.site/
C++ Programming Online Directory
R Programming
https://r-programming.0x3d.site/
R Programming Online Directory
Perl
https://perl.0x3d.site/
Perl Online Directory
Java
https://java.0x3d.site/
Java Online Directory
Kotlin
https://kotlin.0x3d.site/
Kotlin Online Directory
PHP
https://php.0x3d.site/
PHP Online Directory
React JS
https://react.0x3d.site/
React JS Online Directory
Angular
https://angular.0x3d.site/
Angular JS Online Directory