SlideShare une entreprise Scribd logo
1  sur  125
Télécharger pour lire hors ligne


Redis
›   SET note1:title "Mittag"
›   SET note1:message "nicht vergessen"

›   KEYS note1:*
›   GET note1:title
›   DEL note1:title note1:message
http://bit.ly/ISv9f6
R venDB
 a
›
›
›
›
    ›
›
›
›
›
›
›
    ›
    ›
›
using (var documentStore = new EmbeddableDocumentStore{
                           RunInMemory = true}.Initialize())
{
    using (var session = documentStore.OpenSession())
    {
        // Run complex test scenarious
    }
}
›
›


›
›
›
Ayende Rahien on the HTTP API - http://ravendb.net/documentation/docs-http-api-restful
›
  ›
  ›

C:>curl -X GET http://localhost:8080/docs/Categories/1 -i
HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
ETag: 00000000-0000-0200-0000-000000000004
{
       "Name" : "Normal Importance",
       "Color" : "green"
}
var notes = session                      var notes = session.Advanced
.Query<Note>()                           .LuceneQuery<Note>()
.Where(n => n.Category == "Important")   .Where("Category:Important")
.ToArray();                              .ToArray();
MongoDB
CODASYL model                   SQL               Agile becoming more   Google            MongoDB initial
   published                  invented                    popular        BigTable             release




IBM’s                                     Oracle                   Brewer’s      Amazon
 IMS                  INGRES             founded                   CAP born      Dynamo




1966    1969   1970    1973     1974     1977      1985   1990’s     2000     2004    2007 2008 2009


                                                                                  10gen        NoSQL
       Codd publishes                     Term “object-oriented                  founded      Movement
   relational model paper                   database” appears
           in 1970                                                                   Apache Cassandra
                                                                                       initial release
›
›
›
–
›   use WebNote
›   db.Notes.save(
       {
         Title: 'Mittag',
         Message: 'nicht vergessen‘
       }
    );




›   db.Notes.save
–

for(i=0; i<1000; i++) {
     ['quiz', 'essay', 'exam'].forEach(function(name) {
        var score = Math.floor(Math.random() * 50) + 50;
        db.scores.save({student: i, name: name, score:
   score});
     });
   }
   db.scores.count();
–

›   db.Notes.find();
›   db.Notes.find({ Title: /Test/i });
›   db.Notes.find(
      { "Categories.Color": "red"}).limit(1);
–
›   db.Notes.update({Title: 'Test'},
                    {'$set': {Categories: []}});

›   db.Notes.update({Title: 'Test'},
                    {'$push': {
                                Categories:
                                {Color: 'Red'}
                              }
                    });
–
›   db.dropDatabase();
›   db.Notes.drop();
›   db.Notes.remove();
Consistency
Hands ON!
use digg
db.stories.findOne();
›   use digg;
›   db.people.update({name: 'Smith'},
                     {'$set': {interests: []}});
›    db.people.update({name: 'Smith'},
                     {'$push': {interests: ['chess']}});
var map = function() {
   emit(this.user.name, {diggs: this.diggs,
   posts: 0});
};
var reduce = function(key, values) {
   var diggs = 0;
   var posts = 0;
   values.forEach(function(doc) {
                diggs += doc.diggs;
                posts += 1;
   });
   return {diggs: diggs, posts: posts};
};
db.stories.mapReduce(map, reduce, {out:
  'digg_users'});


db.digg_users.find();
JaWOHL!
Schema
 Design
http://bsonspec.org

> db.shapes.find()

›   { _id: "1", type: "c", area: 3.14, radius: 1}
›   { _id: "2", type: "s", area: 4,    length: 2}
›   { _id: "3", type: "r", area: 10,   length: 5, width: 2}




// Shapes mit radius > 0 finden
> db.shapes.find( { radius: { $gt: 0 } } )
blogs: {
    author : “Johannes",
    date : ISODate("2011-09-18T09:56:06.298Z"),
    comments : [
      {
          author : “Klaus",
          date : ISODate("2011-09-19T09:56:06.298Z"),
          text : “toller Artikel"
      }
    ]
}
blogs: { _id: 1000,
         author: “Johannes",
         date: ISODate("2011-09-18"),
         comments: [ {comment : 1)} ]}


comments : { _id : 1,
             blog: 1000,
             author : “Klaus",
             date : ISODate("2011-09-19")}


> blog = db.blogs.find({ text: "Destination Moon" });
> db.comments.find( { blog: blog._id } );
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }

// Jede Kategorie verlinkt die IDs der Produkte
categories:
   { _id: 20, name: "adventure",
     product_ids: [ 10, 11, 12 ] }

categories:
   { _id: 21, name: "movie",
     product_ids: [ 10 ] }
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }

// Jede Kategorie verlinkt die IDs der Produkte
categories:
   { _id: 20, name: "adventure",
     product_ids: [ 10, 11, 12 ] }

categories:
   { _id: 21, name: "movie",
     product_ids: [ 10 ] }


// Alle Kategorien für ein Produkt
> db.categories.find( { product_ids: 10 } )
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }

// Kategorien beinhalten keine Assoziationen
categories:
   { _id: 20,
     name: "adventure"}
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }

// Kategorien beinhalten keine Assoziationen
categories:
   { _id: 20,
     name: "adventure"}

// Alle Produkte für eine Kategorie
> db.products.find( { category_ids: 20 } )
// Jedes Produkt verlinkt die IDs der Kategorien
products:
      { _id: 10, name: "Destination Moon",
        category_ids: [ 20, 30 ] }

// Kategorien beinhalten keine Assoziationen
categories:
   { _id: 20,
     name: "adventure"}

// Alle Produkte für eine Kategorie
> db.products.find( { category_ids: 20 } )

// Alle Kategorien für ein Produkt product
> product = db.products.find( { _id: some_id } )
> db.categories.find({_id: {$in : product.category_ids}})
Software Tests




Contenu connexe

Tendances

Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRick Copeland
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryRebecca Murphey
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented ArchitectureLuiz Messias
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDBVyacheslav
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery FundamentalsGil Fink
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2Takahiro Inoue
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...Sencha
 
Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017Atenea tech
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsAlexander Rubin
 
Contando uma história com O.O.
Contando uma história com O.O.Contando uma história com O.O.
Contando uma história com O.O.Vagner Zampieri
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code OrganizationRebecca Murphey
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤Takahiro Inoue
 
Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Karsten Dambekalns
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»e-Legion
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGrant Goodale
 

Tendances (20)

jQuery
jQueryjQuery
jQuery
 
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and MingRapid and Scalable Development with MongoDB, PyMongo, and Ming
Rapid and Scalable Development with MongoDB, PyMongo, and Ming
 
Cleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQueryCleaner, Leaner, Meaner: Refactoring your jQuery
Cleaner, Leaner, Meaner: Refactoring your jQuery
 
Command-Oriented Architecture
Command-Oriented ArchitectureCommand-Oriented Architecture
Command-Oriented Architecture
 
Storing tree structures with MongoDB
Storing tree structures with MongoDBStoring tree structures with MongoDB
Storing tree structures with MongoDB
 
jQuery Fundamentals
jQuery FundamentalsjQuery Fundamentals
jQuery Fundamentals
 
MongoDB全機能解説2
MongoDB全機能解説2MongoDB全機能解説2
MongoDB全機能解説2
 
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
SenchaCon 2016: Add Magic to Your Ext JS Apps with D3 Visualizations - Vitaly...
 
Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017Layout discovery. Drupal Summer Barcelona 2017
Layout discovery. Drupal Summer Barcelona 2017
 
MySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of ThingsMySQL flexible schema and JSON for Internet of Things
MySQL flexible schema and JSON for Internet of Things
 
Contando uma história com O.O.
Contando uma história com O.O.Contando uma história com O.O.
Contando uma história com O.O.
 
Functionality Focused Code Organization
Functionality Focused Code OrganizationFunctionality Focused Code Organization
Functionality Focused Code Organization
 
MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤MongoDBで作るソーシャルデータ新解析基盤
MongoDBで作るソーシャルデータ新解析基盤
 
jQuery's Secrets
jQuery's SecretsjQuery's Secrets
jQuery's Secrets
 
Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3Transparent Object Persistence with FLOW3
Transparent Object Persistence with FLOW3
 
Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»Юрий Буянов «Squeryl — ORM с человеческим лицом»
Юрий Буянов «Squeryl — ORM с человеческим лицом»
 
Jquery
JqueryJquery
Jquery
 
Groovy scripts with Groovy
Groovy scripts with GroovyGroovy scripts with Groovy
Groovy scripts with Groovy
 
Geospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDBGeospatial Indexing and Querying with MongoDB
Geospatial Indexing and Querying with MongoDB
 
Prototype UI Intro
Prototype UI IntroPrototype UI Intro
Prototype UI Intro
 

En vedette

2011-12-13 NoSQL aus der Praxis
2011-12-13 NoSQL aus der Praxis2011-12-13 NoSQL aus der Praxis
2011-12-13 NoSQL aus der PraxisJohannes Hoppe
 
DMDW 8. Student Presentation - Groovy to MongoDB
DMDW 8. Student Presentation - Groovy to MongoDBDMDW 8. Student Presentation - Groovy to MongoDB
DMDW 8. Student Presentation - Groovy to MongoDBJohannes Hoppe
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScriptJohannes Hoppe
 
2013 05-03 - HTML5 & JavaScript Security
2013 05-03 -  HTML5 & JavaScript Security2013 05-03 -  HTML5 & JavaScript Security
2013 05-03 - HTML5 & JavaScript SecurityJohannes Hoppe
 
Ria 09 trends_and_technologies
Ria 09 trends_and_technologiesRia 09 trends_and_technologies
Ria 09 trends_and_technologiesJohannes Hoppe
 
Ria 03 - Hello ASP.NET MVC
Ria 03 - Hello ASP.NET MVCRia 03 - Hello ASP.NET MVC
Ria 03 - Hello ASP.NET MVCJohannes Hoppe
 

En vedette (6)

2011-12-13 NoSQL aus der Praxis
2011-12-13 NoSQL aus der Praxis2011-12-13 NoSQL aus der Praxis
2011-12-13 NoSQL aus der Praxis
 
DMDW 8. Student Presentation - Groovy to MongoDB
DMDW 8. Student Presentation - Groovy to MongoDBDMDW 8. Student Presentation - Groovy to MongoDB
DMDW 8. Student Presentation - Groovy to MongoDB
 
2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript2013-06-24 - Software Craftsmanship with JavaScript
2013-06-24 - Software Craftsmanship with JavaScript
 
2013 05-03 - HTML5 & JavaScript Security
2013 05-03 -  HTML5 & JavaScript Security2013 05-03 -  HTML5 & JavaScript Security
2013 05-03 - HTML5 & JavaScript Security
 
Ria 09 trends_and_technologies
Ria 09 trends_and_technologiesRia 09 trends_and_technologies
Ria 09 trends_and_technologies
 
Ria 03 - Hello ASP.NET MVC
Ria 03 - Hello ASP.NET MVCRia 03 - Hello ASP.NET MVC
Ria 03 - Hello ASP.NET MVC
 

Similaire à Redis and MongoDB Basics for Beginners

10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data ModelingDATAVERSITY
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDBrogerbodamer
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsMongoDB
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - GuilinJackson Tian
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling rogerbodamer
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
Active Record Inheritance in Rails
Active Record Inheritance in RailsActive Record Inheritance in Rails
Active Record Inheritance in RailsSandip Ransing
 
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & Aggregation
Webinar: Applikationsentwicklung mit MongoDB: Teil 5: Reporting & AggregationWebinar: Applikationsentwicklung mit MongoDB: Teil 5: Reporting & Aggregation
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & AggregationMongoDB
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchAppsBradley Holt
 
1403 app dev series - session 5 - analytics
1403   app dev series - session 5 - analytics1403   app dev series - session 5 - analytics
1403 app dev series - session 5 - analyticsMongoDB
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...MongoDB
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScriptAndrew Dupont
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDBDoThinger
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)Uwe Printz
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDBAlex Bilbie
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your CodeDrupalDay
 

Similaire à Redis and MongoDB Basics for Beginners (20)

10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling10gen Presents Schema Design and Data Modeling
10gen Presents Schema Design and Data Modeling
 
Schema Design with MongoDB
Schema Design with MongoDBSchema Design with MongoDB
Schema Design with MongoDB
 
Webinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev TeamsWebinar: General Technical Overview of MongoDB for Dev Teams
Webinar: General Technical Overview of MongoDB for Dev Teams
 
Mongoskin - Guilin
Mongoskin - GuilinMongoskin - Guilin
Mongoskin - Guilin
 
Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling Intro to MongoDB and datamodeling
Intro to MongoDB and datamodeling
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Active Record Inheritance in Rails
Active Record Inheritance in RailsActive Record Inheritance in Rails
Active Record Inheritance in Rails
 
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & Aggregation
Webinar: Applikationsentwicklung mit MongoDB: Teil 5: Reporting & AggregationWebinar: Applikationsentwicklung mit MongoDB: Teil 5: Reporting & Aggregation
Webinar: Applikationsentwicklung mit MongoDB : Teil 5: Reporting & Aggregation
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
MongoDB With Style
MongoDB With StyleMongoDB With Style
MongoDB With Style
 
OSCON 2011 CouchApps
OSCON 2011 CouchAppsOSCON 2011 CouchApps
OSCON 2011 CouchApps
 
1403 app dev series - session 5 - analytics
1403   app dev series - session 5 - analytics1403   app dev series - session 5 - analytics
1403 app dev series - session 5 - analytics
 
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
 
Writing Maintainable JavaScript
Writing Maintainable JavaScriptWriting Maintainable JavaScript
Writing Maintainable JavaScript
 
Starting with MongoDB
Starting with MongoDBStarting with MongoDB
Starting with MongoDB
 
MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)MongoDB for Coder Training (Coding Serbia 2013)
MongoDB for Coder Training (Coding Serbia 2013)
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
 
Your Entity, Your Code
Your Entity, Your CodeYour Entity, Your Code
Your Entity, Your Code
 
Doctrine and NoSQL
Doctrine and NoSQLDoctrine and NoSQL
Doctrine and NoSQL
 

Plus de Johannes Hoppe

2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung MosbachJohannes Hoppe
 
Einführung in Angular 2
Einführung in Angular 2Einführung in Angular 2
Einführung in Angular 2Johannes Hoppe
 
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und IonicMDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und IonicJohannes Hoppe
 
2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf Azure2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf AzureJohannes Hoppe
 
2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript SecurityJohannes Hoppe
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScriptJohannes Hoppe
 
2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo db2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo dbJohannes Hoppe
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best PracticesJohannes Hoppe
 
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGLJohannes Hoppe
 
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und MongodbJohannes Hoppe
 
2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGLJohannes Hoppe
 
2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDB2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDBJohannes Hoppe
 
2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDB2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDBJohannes Hoppe
 
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDBJohannes Hoppe
 
2012-04-12 - AOP .NET UserGroup Niederrhein
2012-04-12 - AOP .NET UserGroup Niederrhein2012-04-12 - AOP .NET UserGroup Niederrhein
2012-04-12 - AOP .NET UserGroup NiederrheinJohannes Hoppe
 
2012-03-20 - Getting started with Node.js and MongoDB on MS Azure
2012-03-20 - Getting started with Node.js and MongoDB on MS Azure2012-03-20 - Getting started with Node.js and MongoDB on MS Azure
2012-03-20 - Getting started with Node.js and MongoDB on MS AzureJohannes Hoppe
 
2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NETJohannes Hoppe
 
2011-06-27 - AOP - .NET User Group Rhein Neckar
2011-06-27 - AOP - .NET User Group Rhein Neckar2011-06-27 - AOP - .NET User Group Rhein Neckar
2011-06-27 - AOP - .NET User Group Rhein NeckarJohannes Hoppe
 
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)Johannes Hoppe
 
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)Johannes Hoppe
 

Plus de Johannes Hoppe (20)

2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach
 
Einführung in Angular 2
Einführung in Angular 2Einführung in Angular 2
Einführung in Angular 2
 
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und IonicMDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
MDC kompakt 2014: Hybride Apps mit Cordova, AngularJS und Ionic
 
2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf Azure2012-06-25 - MapReduce auf Azure
2012-06-25 - MapReduce auf Azure
 
2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security2013-06-25 - HTML5 & JavaScript Security
2013-06-25 - HTML5 & JavaScript Security
 
2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript2013-06-15 - Software Craftsmanship mit JavaScript
2013-06-15 - Software Craftsmanship mit JavaScript
 
2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo db2013 02-26 - Software Tests with Mongo db
2013 02-26 - Software Tests with Mongo db
 
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
2013-02-21 - .NET UG Rhein-Neckar: JavaScript Best Practices
 
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL2012-10-16 - WebTechCon 2012: HTML5 & WebGL
2012-10-16 - WebTechCon 2012: HTML5 & WebGL
 
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
2012-10-12 - NoSQL in .NET - mit Redis und Mongodb
 
2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL
 
2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDB2012-09-17 - WDC12: Node.js & MongoDB
2012-09-17 - WDC12: Node.js & MongoDB
 
2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDB2012-05-14 NoSQL in .NET - mit Redis und MongoDB
2012-05-14 NoSQL in .NET - mit Redis und MongoDB
 
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
2012-05-10 - UG Karlsruhe: NoSQL in .NET - mit Redis und MongoDB
 
2012-04-12 - AOP .NET UserGroup Niederrhein
2012-04-12 - AOP .NET UserGroup Niederrhein2012-04-12 - AOP .NET UserGroup Niederrhein
2012-04-12 - AOP .NET UserGroup Niederrhein
 
2012-03-20 - Getting started with Node.js and MongoDB on MS Azure
2012-03-20 - Getting started with Node.js and MongoDB on MS Azure2012-03-20 - Getting started with Node.js and MongoDB on MS Azure
2012-03-20 - Getting started with Node.js and MongoDB on MS Azure
 
2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET
 
2011-06-27 - AOP - .NET User Group Rhein Neckar
2011-06-27 - AOP - .NET User Group Rhein Neckar2011-06-27 - AOP - .NET User Group Rhein Neckar
2011-06-27 - AOP - .NET User Group Rhein Neckar
 
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 5. Student Presentation - Pentaho Data Integration (Kettle)
 
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)
DMDW 7. Student Presentation - Pentaho Data Integration (Kettle)
 

Dernier

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
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 2024Rafal Los
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
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...Miguel Araújo
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 

Dernier (20)

Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
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...
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
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
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 

Redis and MongoDB Basics for Beginners

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 16. Redis
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. SET note1:title "Mittag" › SET note1:message "nicht vergessen" › KEYS note1:* › GET note1:title › DEL note1:title note1:message
  • 25.
  • 26.
  • 27.
  • 28.
  • 30.
  • 32.
  • 33.
  • 35.
  • 36. › › ›
  • 37.
  • 38.
  • 40.
  • 41. › › ›
  • 42. using (var documentStore = new EmbeddableDocumentStore{ RunInMemory = true}.Initialize()) { using (var session = documentStore.OpenSession()) { // Run complex test scenarious } }
  • 44. Ayende Rahien on the HTTP API - http://ravendb.net/documentation/docs-http-api-restful
  • 45. › › › C:>curl -X GET http://localhost:8080/docs/Categories/1 -i HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 ETag: 00000000-0000-0200-0000-000000000004 { "Name" : "Normal Importance", "Color" : "green" }
  • 46.
  • 47. var notes = session var notes = session.Advanced .Query<Note>() .LuceneQuery<Note>() .Where(n => n.Category == "Important") .Where("Category:Important") .ToArray(); .ToArray();
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54. CODASYL model SQL Agile becoming more Google MongoDB initial published invented popular BigTable release IBM’s Oracle Brewer’s Amazon IMS INGRES founded CAP born Dynamo 1966 1969 1970 1973 1974 1977 1985 1990’s 2000 2004 2007 2008 2009 10gen NoSQL Codd publishes Term “object-oriented founded Movement relational model paper database” appears in 1970 Apache Cassandra initial release
  • 55.
  • 56.
  • 58.
  • 59. – › use WebNote › db.Notes.save( { Title: 'Mittag', Message: 'nicht vergessen‘ } ); › db.Notes.save
  • 60. – for(i=0; i<1000; i++) { ['quiz', 'essay', 'exam'].forEach(function(name) { var score = Math.floor(Math.random() * 50) + 50; db.scores.save({student: i, name: name, score: score}); }); } db.scores.count();
  • 61. – › db.Notes.find(); › db.Notes.find({ Title: /Test/i }); › db.Notes.find( { "Categories.Color": "red"}).limit(1);
  • 62. – › db.Notes.update({Title: 'Test'}, {'$set': {Categories: []}}); › db.Notes.update({Title: 'Test'}, {'$push': { Categories: {Color: 'Red'} } });
  • 63. – › db.dropDatabase(); › db.Notes.drop(); › db.Notes.remove();
  • 64.
  • 65.
  • 67.
  • 68.
  • 69.
  • 70.
  • 71.
  • 72.
  • 73.
  • 74.
  • 75.
  • 76.
  • 77.
  • 78.
  • 79.
  • 81.
  • 83.
  • 84. use digg; › db.people.update({name: 'Smith'}, {'$set': {interests: []}}); › db.people.update({name: 'Smith'}, {'$push': {interests: ['chess']}});
  • 85.
  • 86.
  • 87.
  • 88. var map = function() { emit(this.user.name, {diggs: this.diggs, posts: 0}); };
  • 89. var reduce = function(key, values) { var diggs = 0; var posts = 0; values.forEach(function(doc) { diggs += doc.diggs; posts += 1; }); return {diggs: diggs, posts: posts}; };
  • 90. db.stories.mapReduce(map, reduce, {out: 'digg_users'}); db.digg_users.find();
  • 91.
  • 92.
  • 95.
  • 97.
  • 98.
  • 99.
  • 100.
  • 101.
  • 102.
  • 103.
  • 104.
  • 105.
  • 106.
  • 107.
  • 108. > db.shapes.find() › { _id: "1", type: "c", area: 3.14, radius: 1} › { _id: "2", type: "s", area: 4, length: 2} › { _id: "3", type: "r", area: 10, length: 5, width: 2} // Shapes mit radius > 0 finden > db.shapes.find( { radius: { $gt: 0 } } )
  • 109.
  • 110. blogs: { author : “Johannes", date : ISODate("2011-09-18T09:56:06.298Z"), comments : [ { author : “Klaus", date : ISODate("2011-09-19T09:56:06.298Z"), text : “toller Artikel" } ] }
  • 111.
  • 112. blogs: { _id: 1000, author: “Johannes", date: ISODate("2011-09-18"), comments: [ {comment : 1)} ]} comments : { _id : 1, blog: 1000, author : “Klaus", date : ISODate("2011-09-19")} > blog = db.blogs.find({ text: "Destination Moon" }); > db.comments.find( { blog: blog._id } );
  • 113.
  • 114. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] }
  • 115. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] } // Jede Kategorie verlinkt die IDs der Produkte categories: { _id: 20, name: "adventure", product_ids: [ 10, 11, 12 ] } categories: { _id: 21, name: "movie", product_ids: [ 10 ] }
  • 116. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] } // Jede Kategorie verlinkt die IDs der Produkte categories: { _id: 20, name: "adventure", product_ids: [ 10, 11, 12 ] } categories: { _id: 21, name: "movie", product_ids: [ 10 ] } // Alle Kategorien für ein Produkt > db.categories.find( { product_ids: 10 } )
  • 117.
  • 118. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] } // Kategorien beinhalten keine Assoziationen categories: { _id: 20, name: "adventure"}
  • 119. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] } // Kategorien beinhalten keine Assoziationen categories: { _id: 20, name: "adventure"} // Alle Produkte für eine Kategorie > db.products.find( { category_ids: 20 } )
  • 120. // Jedes Produkt verlinkt die IDs der Kategorien products: { _id: 10, name: "Destination Moon", category_ids: [ 20, 30 ] } // Kategorien beinhalten keine Assoziationen categories: { _id: 20, name: "adventure"} // Alle Produkte für eine Kategorie > db.products.find( { category_ids: 20 } ) // Alle Kategorien für ein Produkt product > product = db.products.find( { _id: some_id } ) > db.categories.find({_id: {$in : product.category_ids}})
  • 121.
  • 123.
  • 124.
  • 126.
  • 127.
  • 128. ” J.B. Rainsberger
  • 129.
  • 130.
  • 131.
  • 132.
  • 133.
  • 134.
  • 135.
  • 136. using (var documentStore = new EmbeddableDocumentStore{ RunInMemory = true}.Initialize()) { using (var session = documentStore.OpenSession()) { // Run complex test scenarious } }
  • 137.
  • 139. using (var runner = MongoDbRunner.Start()) { var collection = new MongoClient(runner.ConnectionString) .GetServer() .GetDatabase("TestDatabase") .GetCollection<TestDocument>("TestCollection"); // Run complex test scenarious }
  • 140.
  • 141.
  • 143.
  • 144.