{"id":13626774,"url":"https://github.com/mhewedy/spring-data-jpa-mongodb-expressions","last_synced_at":"2025-10-10T01:32:27.443Z","repository":{"id":48944129,"uuid":"338560911","full_name":"mhewedy/spring-data-jpa-mongodb-expressions","owner":"mhewedy","description":"Use the MongoDB query language to query your relational database, typically from frontend.","archived":false,"fork":false,"pushed_at":"2025-07-20T12:51:00.000Z","size":1639,"stargazers_count":99,"open_issues_count":0,"forks_count":19,"subscribers_count":9,"default_branch":"master","last_synced_at":"2025-07-20T13:04:04.279Z","etag":null,"topics":["hibernate","java","jpa","mongodb","spring","spring-boot","spring-data-jpa"],"latest_commit_sha":null,"homepage":"https://mhewedy.github.io/spring-data-jpa-mongodb-expressions/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mhewedy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-02-13T11:37:59.000Z","updated_at":"2025-07-20T12:50:25.000Z","dependencies_parsed_at":"2024-01-03T01:20:43.540Z","dependency_job_id":"fb8bb1df-622f-424e-b81f-43860afa3714","html_url":"https://github.com/mhewedy/spring-data-jpa-mongodb-expressions","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/mhewedy/spring-data-jpa-mongodb-expressions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhewedy%2Fspring-data-jpa-mongodb-expressions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhewedy%2Fspring-data-jpa-mongodb-expressions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhewedy%2Fspring-data-jpa-mongodb-expressions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhewedy%2Fspring-data-jpa-mongodb-expressions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mhewedy","download_url":"https://codeload.github.com/mhewedy/spring-data-jpa-mongodb-expressions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mhewedy%2Fspring-data-jpa-mongodb-expressions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002407,"owners_count":26083374,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hibernate","java","jpa","mongodb","spring","spring-boot","spring-data-jpa"],"created_at":"2024-08-01T22:00:18.188Z","updated_at":"2025-10-10T01:32:27.434Z","avatar_url":"https://github.com/mhewedy.png","language":"Java","funding_links":[],"categories":["Projects","项目"],"sub_categories":["Database","数据库"],"readme":"# Spring Data JPA MongoDB Expressions\n\n[![Java CI with Maven](https://github.com/mhewedy/spring-data-jpa-mongodb-expressions/actions/workflows/maven.yml/badge.svg)](https://github.com/mhewedy/spring-data-jpa-mongodb-expressions/actions/workflows/maven.yml) \n[![codecov](https://codecov.io/gh/mhewedy/spring-data-jpa-mongodb-expressions/branch/master/graph/badge.svg?token=3BR9MGYVC8)](https://codecov.io/gh/mhewedy/spring-data-jpa-mongodb-expressions)\n[![javadoc](https://javadoc.io/badge2/com.github.mhewedy/spring-data-jpa-mongodb-expressions/javadoc.svg)](https://javadoc.io/doc/com.github.mhewedy/spring-data-jpa-mongodb-expressions) \n[![Join the chat at https://gitter.im/spring-data-jpa-mongodb-expressions/community](https://badges.gitter.im/spring-data-jpa-mongodb-expressions/community.svg)](https://gitter.im/spring-data-jpa-mongodb-expressions/community?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![Tweet](https://img.shields.io/twitter/url/http/shields.io.svg?style=social)](https://twitter.com/intent/tweet?text=Use%20the%20MongoDB%20query%20syntax%20to%20query%20your%20relational%20database\u0026url=https://github.com/mhewedy/spring-data-jpa-mongodb-expressions\u0026via=Github\u0026hashtags=java,springboot,mongodb,jpa,hibernate)\n\n\u003cimage src=\"https://github.com/mhewedy/spring-data-jpa-mongodb-expressions/blob/master/logo.png?raw=true\" style=\"display: block; margin: auto; width: 350px;\"\u003e\n\n### How it works:\n\n1. Customize JPA Repository base class:\n    ```java\n    @SpringBootApplication\n    @EnableJpaRepositories(repositoryBaseClass = ExpressionsRepositoryImpl.class)\n    public class Application { … }\n    ```\n2. Change your repository to extend `ExpressionsRepository`:\n    ```java\n    @Repository\n    public interface EmployeeRepository extends ExpressionsRepository\u003cEmployee, Long\u003e {\n    }\n    ```\n3. Build the controller/service:\n    ```java\n    @PostMapping(\"/search\")\n    public ResponseEntity\u003cPage\u003cEmployeeDto\u003e\u003e search(@RequestBody Expressions expressions, Pageable pageable) {\n\n        return ok().body(\n                    employeeRepository.findAll(expressions, pageable).map(employeeMapper::toDto)\n            );\n    }\n    ```\n4. Send [Mongodb query in JSON](https://mhewedy.github.io/spring-data-jpa-mongodb-expressions/#_how_to_build_the_expressions) from frontend:\n    ```json\n    {\n      \"$or\": [\n        {\"lastName\": \"ibrahim\"},\n        {\n          \"$and\": [\n            {\"firstName\": \"mostafa\"},\n            {\"birthDate\": {\"$gt\": \"1990-01-01\"}}\n          ]\n        }\n      ]\n    }\n    ```\n\n### Learn more\n\nFor a quick start see [this Medium post](https://mohewedy.medium.com/using-mongodb-query-syntax-to-query-relational-database-in-java-57701f0b0f0)\n or [dev.to post](https://dev.to/mhewedy/using-mongodb-query-syntax-to-query-relational-database-in-java-49hf)\n or see [this demo example on Github](https://github.com/springexamples/spring-data-jpa-mongodb-expressions-demo).\n\nSee [documentation website](https://mhewedy.github.io/spring-data-jpa-mongodb-expressions/) for details about how to get started.\n\n### Install:\n\nFor spring-boot 3.x:\n    \n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.mhewedy\u003c/groupId\u003e\n  \u003cartifactId\u003espring-data-jpa-mongodb-expressions\u003c/artifactId\u003e\n  \u003cversion\u003e0.1.9\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\nFor spring-boot 2.x:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.github.mhewedy\u003c/groupId\u003e\n  \u003cartifactId\u003espring-data-jpa-mongodb-expressions\u003c/artifactId\u003e\n  \u003cversion\u003e0.0.8\u003c/version\u003e\n\u003c/dependency\u003e\n\n```\n\n#### 🎖 Special Thanks \n\nSpecial thanks to [Rashad Saif](https://github.com/rashadsaif) and [Hamada Elnoby](https://github.com/hamadaelnopy) for helping in the design, inspring with ideas, and for doing code review.\n    \n#### In the News\nThis repo has been mentioned in [spring.io](http://spring.io/blog/2021/07/06/this-week-in-spring-july-6th-2021) weekly news.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhewedy%2Fspring-data-jpa-mongodb-expressions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmhewedy%2Fspring-data-jpa-mongodb-expressions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmhewedy%2Fspring-data-jpa-mongodb-expressions/lists"}