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

springexamples/spring-data-jpa-mongodb-expressions-demo

Open more actions menu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Demo application for spring-data-jpa-mongodb-expressions

  1. first run the application
  2. start sending querying as below

Example queries:

1. find all employees with last name "ibrahim" or firstname is "mostafa" and birthdate after "1990-01-01", sorting by id desc:

URL:

http://localhost:8080/search?sort=id,desc

Request body:

{
  "$or": [
    {"lastName": "ibrahim"},
    {
      "$and": [
        {"firstName": "mostafa"},
        {
          "birthDate": {"$gt": "1990-01-01"}
        }
      ]
    }
  ]
}

Screenshot:


2. find all employees with last name "ibrahim" or department name contains "sw":

URL:

http://localhost:8080/search

Request body:

{
  "lastName": "ibrahim",
  "department.name": {"$contains":  "sw"}
}


3. query using curl:

curl -XPOST -d '{"firstName": "fofo"}' -H 'content-type: application/json' http://localhost:8080/search?sort=id,desc | jq

Releases

No releases published

Packages

No packages published

Languages

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