SlideShare a Scribd company logo
1 of 26
MongoDB + JAVA + Spring data
Anton Sulzhenko
Java Software Engineer
Anton_Sulzhenko@epam.com
MongoDB + Java + Spring Data
  MongoDB


  Java


  Spring Data
3
         MongoDB           Java       Spring Data

What is NoSQL?
• Non-relational data
• Schemaless
• No JOINs, No complex transactions
• Horizontal scalability
4
        MongoDB           Java       Spring Data



• Key-value(Redis, MemcaheDB)
• Wide column(BigTable, Cassandra, HBase)
• Document(MongoDB, CouchDB, Riak)
• Graph(Neo4j, FlockDB)
5
MongoDB   Java   Spring Data
MongoDB
Documented-oriented database
7
             MongoDB          Java          Spring Data

 MongoDB Terminology
RDBMS                            Mongo DB
Database                         Database

Table                            Collection

Row                              JSON document

Column                           Field

Index                            Index

Join                             Embedded documents & linking

Aggregation (e.g. group by)      Aggregation framework
8
         MongoDB                 Java      Spring Data

MongoDB Features
• JSON data model with dynamic schemas
• CRUD operations
• Atomic document operations
• Ad hoq Queries like SQL (equality, regexp, ranges, geospatial)
• Full, flexible index support
• Auto-sharding for horizontal scalability
• Built-in replication and high availability
9
         MongoDB             Java        Spring Data

MongoDB Drivers
• One wire protocol for all client languages
• A driver implementation per language
• Responsibilities:
 - Converting language dependent data structures <-> BSON
 - Generating ObjectId for _id field
10




MongoDB + Java + Spring Data
  MongoDB


  Java


  Spring Data
11
           MongoDB           Java      Spring Data

MongoDB Java Driver Features
• CRUD
• Support for replica sets
• Connection pooling
• Distributed reads to slave servers
• BSON serializerdesirializer
• JSON serializerdesirializer
• GridFS
12
    MongoDB    Java   Spring Data

MongoDB Java Driver Usage
13




MongoDB + Java + Spring Data
  MongoDB


  Java


  Spring Data
SPRING DATA
MongoDB
15
           MongoDB                 Java          Spring Data

Spring Data MongoDB
• Templating
   • Resource abstraction
   • Configure connections to mongod/mongos node(s)
   • Collection lifecycle (create/drop)
   • Map/Reduce / Aggregation

• Object mapping
  • Annotation based: @Document, @Field, @Index etc.
  • Classes are mapped to collections, Java Objects to documents

• Repository Support
  • Queries are derived from method signatures
  • Geospatial Queries
16
               MongoDB                Java              Spring Data


Instantiating MongoTemplate using XML based metadata:
17
              MongoDB               Java      Spring Data


Sample CRUD operations using MongoTemplate:
18
        MongoDB           Java   Spring Data



 Mapping annotation overview:
• @Id
• @Document
• @DBRef
• @Indexed
• @CompoundIndex
• @GeoSpatialIndexed
• @Transient
• @PersistenceConstructor
• @Value
19
MongoDB   Java   Spring Data
20
           MongoDB                Java          Spring Data

Spring Data MongoDB: Repositories
• Main concept:
  • Use the signature of a method to derive the query(at runtime)
• Base implementations / abstractions for
  • CRUD operations
  • Paging
  • Sorting
21
      MongoDB     Java    Spring Data

Spring Data MongoDB: Repositories
22
                 MongoDB                 Java             Spring Data

  Spring Data MongoDB: Repositories
 Supported keywords for query methods:
                     Keyword                                          Logical result
GreaterThan                                 {"age" : {"$gt" : age}}
LessThan                                    {"age" : {"$lt" : age}}
Between                                     {"age" : {"$gt" : from, "$lt" : to}}
IsNotNull, NotNull                          {"age" : {"$ne" : null}}
IsNull, Null                                {"age" : null}
Like                                        {"age" : age} ( age as regex)
(No keyword)                                {"age" : name}
Not                                         {"age" : {"$ne" : name}}
Near                                        {"location" : {"$near" : [x,y]}}
Within                                      {"location" : {"$within" : {"$center" : [ [x, y], distance]}}}
Within                                      {"location" : {"$within" : {"$box" : [ [x1, y1], x2, y2]}}}
23
      MongoDB     Java    Spring Data

Spring Data MongoDB: Repositories
24
         MongoDB               Java    Spring Data




• Map/Reduce / Aggregation framework
• Index management
• Support for GridFS
• Geospatial indexes/queries
• Optimistic Locking
25
           MongoDB                  Java   Spring Data




• 10gen Education
   • https://education.10gen.com/
• Spring Data - MongoDB
  • http://www.springsource.org/spring-data/mongodb
• The Little MongoDB Book
  • http://openmymind.net/2011/3/28/The-Little-MongoDB-Book/
26




   Questions?
       MongoDB


       Java


       Spring Data


Anton Sulzhenko      Anton_Sulzhenko@epam.com

More Related Content

What's hot

jpa-hibernate-presentation
jpa-hibernate-presentationjpa-hibernate-presentation
jpa-hibernate-presentation
John Slick
 

What's hot (20)

JHipster overview
JHipster overviewJHipster overview
JHipster overview
 
Introduction Django
Introduction DjangoIntroduction Django
Introduction Django
 
The Django Web Application Framework 2
The Django Web Application Framework 2The Django Web Application Framework 2
The Django Web Application Framework 2
 
Introduction to React JS
Introduction to React JSIntroduction to React JS
Introduction to React JS
 
Hexagonal architecture with Spring Boot
Hexagonal architecture with Spring BootHexagonal architecture with Spring Boot
Hexagonal architecture with Spring Boot
 
Angular
AngularAngular
Angular
 
Spring MVC Framework
Spring MVC FrameworkSpring MVC Framework
Spring MVC Framework
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
jpa-hibernate-presentation
jpa-hibernate-presentationjpa-hibernate-presentation
jpa-hibernate-presentation
 
Domain Driven Design
Domain Driven DesignDomain Driven Design
Domain Driven Design
 
Arquitetura Node com NestJS
Arquitetura Node com NestJSArquitetura Node com NestJS
Arquitetura Node com NestJS
 
Spring boot
Spring bootSpring boot
Spring boot
 
introduction to Vue.js 3
introduction to Vue.js 3 introduction to Vue.js 3
introduction to Vue.js 3
 
MongoDB Aggregation Framework
MongoDB Aggregation FrameworkMongoDB Aggregation Framework
MongoDB Aggregation Framework
 
Spring boot jpa
Spring boot jpaSpring boot jpa
Spring boot jpa
 
Grafana is not enough: DIY user interfaces for Prometheus
Grafana is not enough: DIY user interfaces for PrometheusGrafana is not enough: DIY user interfaces for Prometheus
Grafana is not enough: DIY user interfaces for Prometheus
 
Vue js for beginner
Vue js for beginner Vue js for beginner
Vue js for beginner
 
Spring Boot in Action
Spring Boot in Action Spring Boot in Action
Spring Boot in Action
 
Spring data jpa
Spring data jpaSpring data jpa
Spring data jpa
 
Curso de WebServlets (Java EE 7)
Curso de WebServlets (Java EE 7)Curso de WebServlets (Java EE 7)
Curso de WebServlets (Java EE 7)
 

Viewers also liked

Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
MongoDB
 
Spring + JPA + DAO Step by Step
Spring + JPA + DAO Step by StepSpring + JPA + DAO Step by Step
Spring + JPA + DAO Step by Step
Guo Albert
 

Viewers also liked (14)

Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Buenas prácticas para pequeños/medianos operadores de telefonía basados en Op...
Buenas prácticas para pequeños/medianos operadores de telefonía basados en Op...Buenas prácticas para pequeños/medianos operadores de telefonía basados en Op...
Buenas prácticas para pequeños/medianos operadores de telefonía basados en Op...
 
MongoDB + Spring
MongoDB + SpringMongoDB + Spring
MongoDB + Spring
 
The Spring Data MongoDB Project
The Spring Data MongoDB ProjectThe Spring Data MongoDB Project
The Spring Data MongoDB Project
 
Spring Data y Mongo DB en un proyecto Real
Spring Data y Mongo DB en un proyecto RealSpring Data y Mongo DB en un proyecto Real
Spring Data y Mongo DB en un proyecto Real
 
Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8Reactive Access to MongoDB from Java 8
Reactive Access to MongoDB from Java 8
 
Spring + JPA + DAO Step by Step
Spring + JPA + DAO Step by StepSpring + JPA + DAO Step by Step
Spring + JPA + DAO Step by Step
 
Génie Logiciel : les tests
Génie Logiciel : les testsGénie Logiciel : les tests
Génie Logiciel : les tests
 
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
Hadoop, the Apple of Our Eyes (這些年,我們一起追的 Hadoop)
 
Spring Data, Jongo & Co.
Spring Data, Jongo & Co.Spring Data, Jongo & Co.
Spring Data, Jongo & Co.
 
Morphia, Spring Data & Co.
Morphia, Spring Data & Co.Morphia, Spring Data & Co.
Morphia, Spring Data & Co.
 
Tests & recette - Les fondamentaux
Tests & recette - Les fondamentauxTests & recette - Les fondamentaux
Tests & recette - Les fondamentaux
 
Présentation Agile Testing
Présentation Agile TestingPrésentation Agile Testing
Présentation Agile Testing
 

Similar to MongoDB + Java + Spring Data

BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
Tobias Trelle
 
Scalany mongodb aug10
Scalany mongodb aug10Scalany mongodb aug10
Scalany mongodb aug10
bwmcadams
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
MongoDB
 
MongoDB in FS
MongoDB in FSMongoDB in FS
MongoDB in FS
MongoDB
 
Data Access 2.0? Please welcome, Spring Data!
Data Access 2.0? Please welcome, Spring Data!Data Access 2.0? Please welcome, Spring Data!
Data Access 2.0? Please welcome, Spring Data!
Oliver Gierke
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver GierkeSpring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
JAX London
 

Similar to MongoDB + Java + Spring Data (20)

using Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundryusing Spring and MongoDB on Cloud Foundry
using Spring and MongoDB on Cloud Foundry
 
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDBBedCon 2013 - Java Persistenz-Frameworks für MongoDB
BedCon 2013 - Java Persistenz-Frameworks für MongoDB
 
Mongodb
MongodbMongodb
Mongodb
 
Scalany mongodb aug10
Scalany mongodb aug10Scalany mongodb aug10
Scalany mongodb aug10
 
2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo2016 feb-23 pyugre-py_mongo
2016 feb-23 pyugre-py_mongo
 
Using MongoDB and Python
Using MongoDB and PythonUsing MongoDB and Python
Using MongoDB and Python
 
Copy of MongoDB .pptx
Copy of MongoDB .pptxCopy of MongoDB .pptx
Copy of MongoDB .pptx
 
MongoDB Tick Data Presentation
MongoDB Tick Data PresentationMongoDB Tick Data Presentation
MongoDB Tick Data Presentation
 
10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup10gen MongoDB Video Presentation at WebGeek DevCup
10gen MongoDB Video Presentation at WebGeek DevCup
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)Using Spring with NoSQL databases (SpringOne China 2012)
Using Spring with NoSQL databases (SpringOne China 2012)
 
MongoDB
MongoDBMongoDB
MongoDB
 
Using MongoDB For BigData in 20 Minutes
Using MongoDB For BigData in 20 MinutesUsing MongoDB For BigData in 20 Minutes
Using MongoDB For BigData in 20 Minutes
 
MongoDB in FS
MongoDB in FSMongoDB in FS
MongoDB in FS
 
Basics of MongoDB
Basics of MongoDB Basics of MongoDB
Basics of MongoDB
 
MongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business InsightsMongoDB and Hadoop: Driving Business Insights
MongoDB and Hadoop: Driving Business Insights
 
Data Access 2.0? Please welcome, Spring Data!
Data Access 2.0? Please welcome, Spring Data!Data Access 2.0? Please welcome, Spring Data!
Data Access 2.0? Please welcome, Spring Data!
 
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver GierkeSpring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
Spring Day | Data Access 2.0? Please Welcome Spring Data! | Oliver Gierke
 
MongoDB NoSQL database a deep dive -MyWhitePaper
MongoDB  NoSQL database a deep dive -MyWhitePaperMongoDB  NoSQL database a deep dive -MyWhitePaper
MongoDB NoSQL database a deep dive -MyWhitePaper
 
mongodb_DS.pptx
mongodb_DS.pptxmongodb_DS.pptx
mongodb_DS.pptx
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

MongoDB + Java + Spring Data

  • 1. MongoDB + JAVA + Spring data Anton Sulzhenko Java Software Engineer Anton_Sulzhenko@epam.com
  • 2. MongoDB + Java + Spring Data MongoDB Java Spring Data
  • 3. 3 MongoDB Java Spring Data What is NoSQL? • Non-relational data • Schemaless • No JOINs, No complex transactions • Horizontal scalability
  • 4. 4 MongoDB Java Spring Data • Key-value(Redis, MemcaheDB) • Wide column(BigTable, Cassandra, HBase) • Document(MongoDB, CouchDB, Riak) • Graph(Neo4j, FlockDB)
  • 5. 5 MongoDB Java Spring Data
  • 7. 7 MongoDB Java Spring Data MongoDB Terminology RDBMS Mongo DB Database Database Table Collection Row JSON document Column Field Index Index Join Embedded documents & linking Aggregation (e.g. group by) Aggregation framework
  • 8. 8 MongoDB Java Spring Data MongoDB Features • JSON data model with dynamic schemas • CRUD operations • Atomic document operations • Ad hoq Queries like SQL (equality, regexp, ranges, geospatial) • Full, flexible index support • Auto-sharding for horizontal scalability • Built-in replication and high availability
  • 9. 9 MongoDB Java Spring Data MongoDB Drivers • One wire protocol for all client languages • A driver implementation per language • Responsibilities: - Converting language dependent data structures <-> BSON - Generating ObjectId for _id field
  • 10. 10 MongoDB + Java + Spring Data MongoDB Java Spring Data
  • 11. 11 MongoDB Java Spring Data MongoDB Java Driver Features • CRUD • Support for replica sets • Connection pooling • Distributed reads to slave servers • BSON serializerdesirializer • JSON serializerdesirializer • GridFS
  • 12. 12 MongoDB Java Spring Data MongoDB Java Driver Usage
  • 13. 13 MongoDB + Java + Spring Data MongoDB Java Spring Data
  • 15. 15 MongoDB Java Spring Data Spring Data MongoDB • Templating • Resource abstraction • Configure connections to mongod/mongos node(s) • Collection lifecycle (create/drop) • Map/Reduce / Aggregation • Object mapping • Annotation based: @Document, @Field, @Index etc. • Classes are mapped to collections, Java Objects to documents • Repository Support • Queries are derived from method signatures • Geospatial Queries
  • 16. 16 MongoDB Java Spring Data Instantiating MongoTemplate using XML based metadata:
  • 17. 17 MongoDB Java Spring Data Sample CRUD operations using MongoTemplate:
  • 18. 18 MongoDB Java Spring Data Mapping annotation overview: • @Id • @Document • @DBRef • @Indexed • @CompoundIndex • @GeoSpatialIndexed • @Transient • @PersistenceConstructor • @Value
  • 19. 19 MongoDB Java Spring Data
  • 20. 20 MongoDB Java Spring Data Spring Data MongoDB: Repositories • Main concept: • Use the signature of a method to derive the query(at runtime) • Base implementations / abstractions for • CRUD operations • Paging • Sorting
  • 21. 21 MongoDB Java Spring Data Spring Data MongoDB: Repositories
  • 22. 22 MongoDB Java Spring Data Spring Data MongoDB: Repositories Supported keywords for query methods: Keyword Logical result GreaterThan {"age" : {"$gt" : age}} LessThan {"age" : {"$lt" : age}} Between {"age" : {"$gt" : from, "$lt" : to}} IsNotNull, NotNull {"age" : {"$ne" : null}} IsNull, Null {"age" : null} Like {"age" : age} ( age as regex) (No keyword) {"age" : name} Not {"age" : {"$ne" : name}} Near {"location" : {"$near" : [x,y]}} Within {"location" : {"$within" : {"$center" : [ [x, y], distance]}}} Within {"location" : {"$within" : {"$box" : [ [x1, y1], x2, y2]}}}
  • 23. 23 MongoDB Java Spring Data Spring Data MongoDB: Repositories
  • 24. 24 MongoDB Java Spring Data • Map/Reduce / Aggregation framework • Index management • Support for GridFS • Geospatial indexes/queries • Optimistic Locking
  • 25. 25 MongoDB Java Spring Data • 10gen Education • https://education.10gen.com/ • Spring Data - MongoDB • http://www.springsource.org/spring-data/mongodb • The Little MongoDB Book • http://openmymind.net/2011/3/28/The-Little-MongoDB-Book/
  • 26. 26 Questions? MongoDB Java Spring Data Anton Sulzhenko Anton_Sulzhenko@epam.com