SlideShare uma empresa Scribd logo
1 de 16
Baixar para ler offline
MongoDB with
Spring Data Document
      Sean@Weaveus
         May 2011
<<interface>>


                      @Autowired
                                    Mongo
                                   Operations

                         Bean
                                     Mongo
                                    Template


                         Bean
                                   MongoDB
                                    Driver




Monday, May 9, 2011                                 2
DB


                      Collection#1        Collection#2
                        Document#1          Document#1

                        Document#2          Document#2

                        Document#3          Document#3

                        Document#4          Document#4

                        Document#5          Document#5




                  Document := {UniqueID, JSON Document}

Monday, May 9, 2011                                       3
Getting Started - Server

   SeaniMac:tmp sean$ ls
   mongodb-osx-x86_64-1.8.1.tgz
   mongodb-osx-x86_64-1.8.1
   SeaniMac:tmp sean$ mkdir -p mongodb-data/db
   SeaniMac:tmp sean$ ./mongodb-osx-x86_64-1.8.1/bin/mongod --dbpath ./
   mongodb-data/db
   Fri May! 6 14:16:48 [initandlisten] MongoDB starting ...
   ...




Monday, May 9, 2011                                                       4
Getting Started - Client

   SeaniMac:tmp sean$ ./mongodb-osx-x86_64-1.8.1/bin/mongo
   MongoDB shell version: 1.8.1
   connecting to: test
   > db.foo.save( { a: 1 } )
   > db.foo.find()
   { "_id" : ObjectId("4dc3855d3044bae59620330d"), "a" : 1 }




Monday, May 9, 2011                                            5
Java(Groovy)
   import com.mongodb.Mongo
   import com.mongodb.DB
   import com.mongodb.DBCollection

   Mongo m = new Mongo()
   println m.databaseNames

   DB db = m.getDB("test")
   println db.collectionNames

   DBCollection dbcol = db.getCollection("foo")
   println dbcol.find().next() // DBObject Instance, BSON

   // results
   [test, admin, db, foo, local]
   [foo, system.indexes]
   [_id:4dc3855d3044bae59620330d, a:1.0]




Monday, May 9, 2011                                         6
Document CRUD



Monday, May 9, 2011                   7
Save


   >   db.things.save({ name: "mongo" })
   >   t = { x : 3 }
   {   "x" : 3 }
   >   db.things.save(t)




Monday, May 9, 2011                        8
Find
   >   db.things.find()
   {   "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" }
   {   "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 }
   >   var cursor = db.things.find();
   >   while (cursor.hasNext()) printjson(cursor.next());
   {   "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" }
   {   "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 }
   >   db.things.find().forEach( printjson )
   {   "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" }
   {   "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 }

   > db.things.find({name:"mongo"}).forEach( printjson );
   { "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" }

   >   db.things.save( {"name":"nosql", "title":"nonRDB"} )
   >   db.things.find( {name:"nosql"}, {title:true} ).forEach
   (   printjson )
   {   "_id" : ObjectId("4dc3ae133044bae596203312"), "title" : "nonRDB" }



Monday, May 9, 2011                                                         9
Remove

   >   db.things.remove({name:"mongo"})
   >   db.things.remove({"_id":ObjectId("4dc3ae133044bae596203312")})
   >   db.things.find()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
   {   "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 }




Monday, May 9, 2011                                                     10
with Spring Data



Monday, May 9, 2011                      11
MongoTemplate

                •     Document databases extension to Spring
                      Programming Model
                •     SPEL
                •     DataException hierarchy
                •     IoC Configuration



Monday, May 9, 2011                                            12
Beans @Configuration or XML-Based




Monday, May 9, 2011                                      13
<<interface>>

                                                     Mongo
                                    Mongo
                      @Autowired                    Repository
                                   Operations
                                                     Mongo
                                                     Criteria
                         Bean
                                     Mongo
                                    Template


                         Bean
                                   MongoDB
                                    Driver




Monday, May 9, 2011                                              14
Object-Document
                      Implicit Conversion




Monday, May 9, 2011                         15
•     MongoRepository

                      •   Method name based Query

                      •   @Query, QueryDSL

                      •   Criteria, Predication Support

                      •   GPS Query

                •     Mapping

                      •   @Document(Instead of @Entity)

                •     Asynchronous Callback



Monday, May 9, 2011                                       16

Mais conteúdo relacionado

Mais procurados

Data-Driven Development Era and Its Technologies
Data-Driven Development Era and Its TechnologiesData-Driven Development Era and Its Technologies
Data-Driven Development Era and Its TechnologiesSATOSHI TAGOMORI
 
A Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapA Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapItai Yaffe
 
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...Wes McKinney
 
Seattle Scalability Mahout
Seattle Scalability MahoutSeattle Scalability Mahout
Seattle Scalability MahoutJake Mannix
 
NoSQL databases pros and cons
NoSQL databases pros and consNoSQL databases pros and cons
NoSQL databases pros and consFabio Fumarola
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionBrian Enochson
 
Bigdata antipatterns
Bigdata antipatternsBigdata antipatterns
Bigdata antipatternsAnurag S
 
Building Better Analytics Workflows (Strata-Hadoop World 2013)
Building Better Analytics Workflows (Strata-Hadoop World 2013)Building Better Analytics Workflows (Strata-Hadoop World 2013)
Building Better Analytics Workflows (Strata-Hadoop World 2013)Wes McKinney
 
Graph Databases for SQL Server Professionals
Graph Databases for SQL Server ProfessionalsGraph Databases for SQL Server Professionals
Graph Databases for SQL Server ProfessionalsStéphane Fréchette
 
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...Modern Data Stack France
 
PyCon Singapore 2013 Keynote
PyCon Singapore 2013 KeynotePyCon Singapore 2013 Keynote
PyCon Singapore 2013 KeynoteWes McKinney
 
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012Amazon Web Services
 
Improving data interoperability in Python and R
Improving data interoperability in Python and RImproving data interoperability in Python and R
Improving data interoperability in Python and RWes McKinney
 
Introduction to Google BigQuery
Introduction to Google BigQueryIntroduction to Google BigQuery
Introduction to Google BigQueryCsaba Toth
 
Performance comparison: Multi-Model vs. MongoDB and Neo4j
Performance comparison: Multi-Model vs. MongoDB and Neo4jPerformance comparison: Multi-Model vs. MongoDB and Neo4j
Performance comparison: Multi-Model vs. MongoDB and Neo4jArangoDB Database
 
The Real-time Web in the Age of Agents
The Real-time Web in the Age of AgentsThe Real-time Web in the Age of Agents
The Real-time Web in the Age of AgentsJoshua Shinavier
 
Optiq: A dynamic data management framework
Optiq: A dynamic data management frameworkOptiq: A dynamic data management framework
Optiq: A dynamic data management frameworkJulian Hyde
 
Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015Taro L. Saito
 

Mais procurados (20)

Data-Driven Development Era and Its Technologies
Data-Driven Development Era and Its TechnologiesData-Driven Development Era and Its Technologies
Data-Driven Development Era and Its Technologies
 
A Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's RoadmapA Day in the Life of a Druid Implementor and Druid's Roadmap
A Day in the Life of a Druid Implementor and Druid's Roadmap
 
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
Practical Medium Data Analytics with Python (10 Things I Hate About pandas, P...
 
Seattle Scalability Mahout
Seattle Scalability MahoutSeattle Scalability Mahout
Seattle Scalability Mahout
 
NoSQL databases pros and cons
NoSQL databases pros and consNoSQL databases pros and cons
NoSQL databases pros and cons
 
NoSQL and MongoDB Introdction
NoSQL and MongoDB IntrodctionNoSQL and MongoDB Introdction
NoSQL and MongoDB Introdction
 
Bigdata antipatterns
Bigdata antipatternsBigdata antipatterns
Bigdata antipatterns
 
Building Better Analytics Workflows (Strata-Hadoop World 2013)
Building Better Analytics Workflows (Strata-Hadoop World 2013)Building Better Analytics Workflows (Strata-Hadoop World 2013)
Building Better Analytics Workflows (Strata-Hadoop World 2013)
 
Graph Databases for SQL Server Professionals
Graph Databases for SQL Server ProfessionalsGraph Databases for SQL Server Professionals
Graph Databases for SQL Server Professionals
 
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...
HUG France Feb 2016 - Migration de données structurées entre Hadoop et RDBMS ...
 
PyCon Singapore 2013 Keynote
PyCon Singapore 2013 KeynotePyCon Singapore 2013 Keynote
PyCon Singapore 2013 Keynote
 
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012
AWS Customer Presentation: Freie Univerisitat - Berlin Summit 2012
 
Improving data interoperability in Python and R
Improving data interoperability in Python and RImproving data interoperability in Python and R
Improving data interoperability in Python and R
 
Introduction to Google BigQuery
Introduction to Google BigQueryIntroduction to Google BigQuery
Introduction to Google BigQuery
 
Performance comparison: Multi-Model vs. MongoDB and Neo4j
Performance comparison: Multi-Model vs. MongoDB and Neo4jPerformance comparison: Multi-Model vs. MongoDB and Neo4j
Performance comparison: Multi-Model vs. MongoDB and Neo4j
 
Linked Process
Linked ProcessLinked Process
Linked Process
 
The Real-time Web in the Age of Agents
The Real-time Web in the Age of AgentsThe Real-time Web in the Age of Agents
The Real-time Web in the Age of Agents
 
Building data pipelines
Building data pipelinesBuilding data pipelines
Building data pipelines
 
Optiq: A dynamic data management framework
Optiq: A dynamic data management frameworkOptiq: A dynamic data management framework
Optiq: A dynamic data management framework
 
Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015Presto @ Treasure Data - Presto Meetup Boston 2015
Presto @ Treasure Data - Presto Meetup Boston 2015
 

Destaque

Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbAlex Sharp
 
Migration from SQL to MongoDB - A Case Study at TheKnot.com
Migration from SQL to MongoDB - A Case Study at TheKnot.com Migration from SQL to MongoDB - A Case Study at TheKnot.com
Migration from SQL to MongoDB - A Case Study at TheKnot.com MongoDB
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbStaples
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbStaples
 
Angular 2 : le réveil de la force
Angular 2 : le réveil de la forceAngular 2 : le réveil de la force
Angular 2 : le réveil de la forceNicolas PENNEC
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Minko Gechev
 

Destaque (9)

Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
 
Mongo db devfestw
Mongo db devfestwMongo db devfestw
Mongo db devfestw
 
From Oracle to MongoDB
From Oracle to MongoDBFrom Oracle to MongoDB
From Oracle to MongoDB
 
Migration from SQL to MongoDB - A Case Study at TheKnot.com
Migration from SQL to MongoDB - A Case Study at TheKnot.com Migration from SQL to MongoDB - A Case Study at TheKnot.com
Migration from SQL to MongoDB - A Case Study at TheKnot.com
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
 
Java and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo dbJava and services code lab spring boot and spring data using mongo db
Java and services code lab spring boot and spring data using mongo db
 
Angular 2 : le réveil de la force
Angular 2 : le réveil de la forceAngular 2 : le réveil de la force
Angular 2 : le réveil de la force
 
Building Universal Applications with Angular 2
Building Universal Applications with Angular 2Building Universal Applications with Angular 2
Building Universal Applications with Angular 2
 
introduction à MongoDB
introduction à MongoDBintroduction à MongoDB
introduction à MongoDB
 

Semelhante a Mongo db with spring data document

Using NoSQL with Yo' SQL
Using NoSQL with Yo' SQLUsing NoSQL with Yo' SQL
Using NoSQL with Yo' SQLRich Thornett
 
Flowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Consjohnrjenson
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbikailan
 
Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Kuo-Chun Su
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBMongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentationHyphen Call
 
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenCloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenPatrick Chanezon
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBTobias Trelle
 
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 MongoDBTobias Trelle
 
Mongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongoDB
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...MongoDB
 
moma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layermoma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layerGadi Oren
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Pôle Systematic Paris-Region
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling Sachin Bhosale
 
Mongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesMongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesronwarshawsky
 

Semelhante a Mongo db with spring data document (20)

Using NoSQL with Yo' SQL
Using NoSQL with Yo' SQLUsing NoSQL with Yo' SQL
Using NoSQL with Yo' SQL
 
Flowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDBFlowdock's full-text search with MongoDB
Flowdock's full-text search with MongoDB
 
MongoDB Pros and Cons
MongoDB Pros and ConsMongoDB Pros and Cons
MongoDB Pros and Cons
 
Rapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodbRapid web development using tornado web and mongodb
Rapid web development using tornado web and mongodb
 
Spring Data MongoDB 介紹
Spring Data MongoDB 介紹Spring Data MongoDB 介紹
Spring Data MongoDB 介紹
 
Mongo learning series
Mongo learning series Mongo learning series
Mongo learning series
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
MongoDB presentation
MongoDB presentationMongoDB presentation
MongoDB presentation
 
CloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heavenCloudFoundry and MongoDb, a marriage made in heaven
CloudFoundry and MongoDb, a marriage made in heaven
 
Java Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDBJava Persistence Frameworks for MongoDB
Java Persistence Frameworks for MongoDB
 
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 at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-finalMongodb at-gilt-groupe-seattle-2012-09-14-final
Mongodb at-gilt-groupe-seattle-2012-09-14-final
 
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
Lessons Learned from Building a Multi-Tenant Saas Content Management System o...
 
A Brief MongoDB Intro
A Brief MongoDB IntroA Brief MongoDB Intro
A Brief MongoDB Intro
 
Introduction to Mongodb
Introduction to MongodbIntroduction to Mongodb
Introduction to Mongodb
 
MongoDB
MongoDBMongoDB
MongoDB
 
moma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layermoma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layer
 
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
Open-Source Analytics Stack on MongoDB, with Schema, Pierre-Alain Jachiet and...
 
MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling MongoDB Introduction and Data Modelling
MongoDB Introduction and Data Modelling
 
Mongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategiesMongo db pefrormance optimization strategies
Mongo db pefrormance optimization strategies
 

Mais de Sean Lee

Git rerere
Git rerereGit rerere
Git rerereSean Lee
 
Cloud foundry practice
Cloud foundry practiceCloud foundry practice
Cloud foundry practiceSean Lee
 
Redis with spring data key value
Redis with spring data key valueRedis with spring data key value
Redis with spring data key valueSean Lee
 
ePUB in brief
ePUB in briefePUB in brief
ePUB in briefSean Lee
 
트렌드 코리아 2011
트렌드 코리아 2011트렌드 코리아 2011
트렌드 코리아 2011Sean Lee
 
Future Health Care 3
Future Health Care 3Future Health Care 3
Future Health Care 3Sean Lee
 
Future Health Care 3
Future Health Care 3Future Health Care 3
Future Health Care 3Sean Lee
 
미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) Pechakucha미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) PechakuchaSean Lee
 

Mais de Sean Lee (8)

Git rerere
Git rerereGit rerere
Git rerere
 
Cloud foundry practice
Cloud foundry practiceCloud foundry practice
Cloud foundry practice
 
Redis with spring data key value
Redis with spring data key valueRedis with spring data key value
Redis with spring data key value
 
ePUB in brief
ePUB in briefePUB in brief
ePUB in brief
 
트렌드 코리아 2011
트렌드 코리아 2011트렌드 코리아 2011
트렌드 코리아 2011
 
Future Health Care 3
Future Health Care 3Future Health Care 3
Future Health Care 3
 
Future Health Care 3
Future Health Care 3Future Health Care 3
Future Health Care 3
 
미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) Pechakucha미래를 읽는 기술(Future Inc) Pechakucha
미래를 읽는 기술(Future Inc) Pechakucha
 

Último

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...DianaGray10
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
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 RobisonAnna Loughnan Colquhoun
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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 DevelopmentsTrustArc
 
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 DiscoveryTrustArc
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024The Digital Insurer
 
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 SavingEdi Saputra
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024SynarionITSolutions
 
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 2024The Digital Insurer
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

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...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
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
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
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
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
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
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 

Mongo db with spring data document

  • 1. MongoDB with Spring Data Document Sean@Weaveus May 2011
  • 2. <<interface>> @Autowired Mongo Operations Bean Mongo Template Bean MongoDB Driver Monday, May 9, 2011 2
  • 3. DB Collection#1 Collection#2 Document#1 Document#1 Document#2 Document#2 Document#3 Document#3 Document#4 Document#4 Document#5 Document#5 Document := {UniqueID, JSON Document} Monday, May 9, 2011 3
  • 4. Getting Started - Server SeaniMac:tmp sean$ ls mongodb-osx-x86_64-1.8.1.tgz mongodb-osx-x86_64-1.8.1 SeaniMac:tmp sean$ mkdir -p mongodb-data/db SeaniMac:tmp sean$ ./mongodb-osx-x86_64-1.8.1/bin/mongod --dbpath ./ mongodb-data/db Fri May! 6 14:16:48 [initandlisten] MongoDB starting ... ... Monday, May 9, 2011 4
  • 5. Getting Started - Client SeaniMac:tmp sean$ ./mongodb-osx-x86_64-1.8.1/bin/mongo MongoDB shell version: 1.8.1 connecting to: test > db.foo.save( { a: 1 } ) > db.foo.find() { "_id" : ObjectId("4dc3855d3044bae59620330d"), "a" : 1 } Monday, May 9, 2011 5
  • 6. Java(Groovy) import com.mongodb.Mongo import com.mongodb.DB import com.mongodb.DBCollection Mongo m = new Mongo() println m.databaseNames DB db = m.getDB("test") println db.collectionNames DBCollection dbcol = db.getCollection("foo") println dbcol.find().next() // DBObject Instance, BSON // results [test, admin, db, foo, local] [foo, system.indexes] [_id:4dc3855d3044bae59620330d, a:1.0] Monday, May 9, 2011 6
  • 8. Save > db.things.save({ name: "mongo" }) > t = { x : 3 } { "x" : 3 } > db.things.save(t) Monday, May 9, 2011 8
  • 9. Find > db.things.find() { "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" } { "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 } > var cursor = db.things.find(); > while (cursor.hasNext()) printjson(cursor.next()); { "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" } { "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 } > db.things.find().forEach( printjson ) { "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" } { "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 } > db.things.find({name:"mongo"}).forEach( printjson ); { "_id" : ObjectId("4dc399fc3044bae59620330e"), "name" : "mongo" } > db.things.save( {"name":"nosql", "title":"nonRDB"} ) > db.things.find( {name:"nosql"}, {title:true} ).forEach ( printjson ) { "_id" : ObjectId("4dc3ae133044bae596203312"), "title" : "nonRDB" } Monday, May 9, 2011 9
  • 10. Remove > db.things.remove({name:"mongo"}) > db.things.remove({"_id":ObjectId("4dc3ae133044bae596203312")}) > db.things.find()!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! { "_id" : ObjectId("4dc3a7913044bae59620330f"), "x" : 3 } Monday, May 9, 2011 10
  • 11. with Spring Data Monday, May 9, 2011 11
  • 12. MongoTemplate • Document databases extension to Spring Programming Model • SPEL • DataException hierarchy • IoC Configuration Monday, May 9, 2011 12
  • 13. Beans @Configuration or XML-Based Monday, May 9, 2011 13
  • 14. <<interface>> Mongo Mongo @Autowired Repository Operations Mongo Criteria Bean Mongo Template Bean MongoDB Driver Monday, May 9, 2011 14
  • 15. Object-Document Implicit Conversion Monday, May 9, 2011 15
  • 16. MongoRepository • Method name based Query • @Query, QueryDSL • Criteria, Predication Support • GPS Query • Mapping • @Document(Instead of @Entity) • Asynchronous Callback Monday, May 9, 2011 16