SlideShare a Scribd company logo
1 of 15
13.03.2017
Dipl-Inf. (FH) Johannes Hoppe
NoSQL
MongoDB Quick Reference Cards
http://www.10gen.com/reference
“Deployment”
› Standardverzeichnis erstellen:
c:datadb
› Server-Start: mongod.exe
› Shell: mongo.exe
CRUD – Create
In der Shell
› use WebNote
› db.Notes.save(
{
Title: 'Mittag',
Message: 'nicht vergessen‘
}
);
So funktioniert der Befehl
› db.Notes.save
CRUD – Create
…with a bit JavaScript
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();
CRUD – Read
Queries werden ebenso im Dokument-Stil spezifiziert
› db.Notes.find();
› db.Notes.find({ Title: /Test/i });
› db.Notes.find(
{ "Categories.Color": "red"}).limit(1);
CRUD – Update
› db.Notes.update({Title: 'Test'},
{'$set': {Categories: []}});
› db.Notes.update({Title: 'Test'},
{'$push': {
Categories:
{Color: 'Red'}
}
});
CRUD – Delete
› db.dropDatabase();
› db.Notes.drop();
› db.Notes.remove();
Hands ON!
Data Import
(hands-on.zip)
cd dump_training
mongorestore -d training -c scores scores.bson
cd dump_digg
mongorestore -d digg -c stories stories.bson
Test
(in the shell)
use digg
db.stories.findOne();
Exercises
1. Find all scores less than 65.
2. Find the lowest quiz score. Find the highest quiz score.
3. Write a query to find all digg stories where the view
count is greater than 1000.
4. Query for all digg stories whose media type is either
'news' or 'images' and where the topic name is
'Comedy’.
5. Find all digg stories where the topic name is
'Television' or the media type is 'videos'. Skip the first 5
results, and limit the result set to 10.
CRUD – Update
› use digg;
› db.people.update({name: 'Smith'},
{'$set': {interests: []}});
› db.people.update({name: 'Smith'},
{'$push': {interests: ['chess']}});
Exercises
1. Set the proper 'grade' attribute for all scores. For
example, users with scores greater than 90 get an 'A.'
Set the grade to ‘B’ for scores falling between 80 and
90.
2. You're being nice, so you decide to add 10 points to
every score on every “final” exam whose score is
lower than 60. How do you do this update?

More Related Content

What's hot

最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!
最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!
最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!Liwei Chou
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDBNate Abele
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & TricksMongoDB
 
MongoDB Shell Tips & Tricks
MongoDB Shell Tips & TricksMongoDB Shell Tips & Tricks
MongoDB Shell Tips & TricksMongoDB
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?Felix Geisendörfer
 
Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Ravi Teja
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationMongoDB
 
Drupal 7: What's In It For You?
Drupal 7: What's In It For You?Drupal 7: What's In It For You?
Drupal 7: What's In It For You?karschsp
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genMongoDB
 
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsBack to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsJoe Drumgoole
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDBMichael Redlich
 
Format xls sheets Demo Mode
Format xls sheets Demo ModeFormat xls sheets Demo Mode
Format xls sheets Demo ModeJared Bourne
 
DBIx::Class walkthrough @ bangalore pm
DBIx::Class walkthrough @ bangalore pmDBIx::Class walkthrough @ bangalore pm
DBIx::Class walkthrough @ bangalore pmSheeju Alex
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...MongoDB
 
Redis data modeling examples
Redis data modeling examplesRedis data modeling examples
Redis data modeling examplesTerry Cho
 
Back to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQLBack to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQLJoe Drumgoole
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDBTakahiro Inoue
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source BridgeChris Anderson
 

What's hot (20)

最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!
最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!
最近 node.js 來勢洶洶, 怎麼辦? 別怕, 我們也有秘密武器 RingoJS!
 
Building Apps with MongoDB
Building Apps with MongoDBBuilding Apps with MongoDB
Building Apps with MongoDB
 
Shell Tips & Tricks
Shell Tips & TricksShell Tips & Tricks
Shell Tips & Tricks
 
MongoDB Shell Tips & Tricks
MongoDB Shell Tips & TricksMongoDB Shell Tips & Tricks
MongoDB Shell Tips & Tricks
 
Dirty - How simple is your database?
Dirty - How simple is your database?Dirty - How simple is your database?
Dirty - How simple is your database?
 
Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.Building a Location-based platform with MongoDB from Zero.
Building a Location-based platform with MongoDB from Zero.
 
Back to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB ApplicationBack to Basics Webinar 2: Your First MongoDB Application
Back to Basics Webinar 2: Your First MongoDB Application
 
Drupal 7: What's In It For You?
Drupal 7: What's In It For You?Drupal 7: What's In It For You?
Drupal 7: What's In It For You?
 
Introduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10genIntroduction to the new official C# Driver developed by 10gen
Introduction to the new official C# Driver developed by 10gen
 
Couchdb w Ruby'm
Couchdb w Ruby'mCouchdb w Ruby'm
Couchdb w Ruby'm
 
Back to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in DocumentsBack to Basics Webinar 3 - Thinking in Documents
Back to Basics Webinar 3 - Thinking in Documents
 
Getting Started with MongoDB
Getting Started with MongoDBGetting Started with MongoDB
Getting Started with MongoDB
 
Format xls sheets Demo Mode
Format xls sheets Demo ModeFormat xls sheets Demo Mode
Format xls sheets Demo Mode
 
DBIx::Class walkthrough @ bangalore pm
DBIx::Class walkthrough @ bangalore pmDBIx::Class walkthrough @ bangalore pm
DBIx::Class walkthrough @ bangalore pm
 
Mongo db for c# developers
Mongo db for c# developersMongo db for c# developers
Mongo db for c# developers
 
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
Webinarserie: Einführung in MongoDB: “Back to Basics” - Teil 3 - Interaktion ...
 
Redis data modeling examples
Redis data modeling examplesRedis data modeling examples
Redis data modeling examples
 
Back to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQLBack to Basics Webinar 1 - Introduction to NoSQL
Back to Basics Webinar 1 - Introduction to NoSQL
 
はじめてのMongoDB
はじめてのMongoDBはじめてのMongoDB
はじめてのMongoDB
 
CouchDB Open Source Bridge
CouchDB Open Source BridgeCouchDB Open Source Bridge
CouchDB Open Source Bridge
 

Viewers also liked

2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung MosbachJohannes Hoppe
 
Brochure Sistema de Información para administración de establecimientos comer...
Brochure Sistema de Información para administración de establecimientos comer...Brochure Sistema de Información para administración de establecimientos comer...
Brochure Sistema de Información para administración de establecimientos comer...Sotosoftco
 
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
 
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-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
 
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Russell Childs
 
Ria 09 trends_and_technologies
Ria 09 trends_and_technologiesRia 09 trends_and_technologies
Ria 09 trends_and_technologiesJohannes Hoppe
 
DMDW Lesson 08 - Further Data Mining Algorithms
DMDW Lesson 08 - Further Data Mining AlgorithmsDMDW Lesson 08 - Further Data Mining Algorithms
DMDW Lesson 08 - Further Data Mining AlgorithmsJohannes Hoppe
 
DMDW Lesson 01 - Introduction
DMDW Lesson 01 - IntroductionDMDW Lesson 01 - Introduction
DMDW Lesson 01 - IntroductionJohannes Hoppe
 
DMDW Lesson 05 + 06 + 07 - Data Mining Applied
DMDW Lesson 05 + 06 + 07 - Data Mining AppliedDMDW Lesson 05 + 06 + 07 - Data Mining Applied
DMDW Lesson 05 + 06 + 07 - Data Mining AppliedJohannes Hoppe
 
DMDW Lesson 03 - Data Warehouse Theory
DMDW Lesson 03 - Data Warehouse TheoryDMDW Lesson 03 - Data Warehouse Theory
DMDW Lesson 03 - Data Warehouse TheoryJohannes Hoppe
 
Geolocation in mongodb
Geolocation in mongodbGeolocation in mongodb
Geolocation in mongodbMongoDB
 
DMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryDMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryJohannes Hoppe
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerMongoDB
 
Sexy DIY-Badges: Mehr als Zertifikate!?
Sexy DIY-Badges: Mehr als Zertifikate!?Sexy DIY-Badges: Mehr als Zertifikate!?
Sexy DIY-Badges: Mehr als Zertifikate!?Anja Lorenz
 
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-Learning
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-LearningHorizon Report 2015: Was ist der nächste heiße Scheiß im E-Learning
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-LearningAnja Lorenz
 
Powerpoint-Karaoke (Erläuterungen)
Powerpoint-Karaoke (Erläuterungen)Powerpoint-Karaoke (Erläuterungen)
Powerpoint-Karaoke (Erläuterungen)Anja Lorenz
 
Exkurs: Save the pixel
Exkurs: Save the pixelExkurs: Save the pixel
Exkurs: Save the pixelJohannes Hoppe
 
3Com 7030-10136
3Com 7030-101363Com 7030-10136
3Com 7030-10136savomir
 
What have you learned from your audience feedback?
What have you learned from your audience feedback?What have you learned from your audience feedback?
What have you learned from your audience feedback?Luke Randall
 

Viewers also liked (20)

2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach2017 - NoSQL Vorlesung Mosbach
2017 - NoSQL Vorlesung Mosbach
 
Brochure Sistema de Información para administración de establecimientos comer...
Brochure Sistema de Información para administración de establecimientos comer...Brochure Sistema de Información para administración de establecimientos comer...
Brochure Sistema de Información para administración de establecimientos comer...
 
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
 
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-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
 
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
Dirac demo (quantum mechanics with C++). Please note: There is a problem with...
 
Ria 09 trends_and_technologies
Ria 09 trends_and_technologiesRia 09 trends_and_technologies
Ria 09 trends_and_technologies
 
DMDW Lesson 08 - Further Data Mining Algorithms
DMDW Lesson 08 - Further Data Mining AlgorithmsDMDW Lesson 08 - Further Data Mining Algorithms
DMDW Lesson 08 - Further Data Mining Algorithms
 
DMDW Lesson 01 - Introduction
DMDW Lesson 01 - IntroductionDMDW Lesson 01 - Introduction
DMDW Lesson 01 - Introduction
 
DMDW Lesson 05 + 06 + 07 - Data Mining Applied
DMDW Lesson 05 + 06 + 07 - Data Mining AppliedDMDW Lesson 05 + 06 + 07 - Data Mining Applied
DMDW Lesson 05 + 06 + 07 - Data Mining Applied
 
DMDW Lesson 03 - Data Warehouse Theory
DMDW Lesson 03 - Data Warehouse TheoryDMDW Lesson 03 - Data Warehouse Theory
DMDW Lesson 03 - Data Warehouse Theory
 
Geolocation in mongodb
Geolocation in mongodbGeolocation in mongodb
Geolocation in mongodb
 
DMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining TheoryDMDW Lesson 04 - Data Mining Theory
DMDW Lesson 04 - Data Mining Theory
 
A Technical Introduction to WiredTiger
A Technical Introduction to WiredTigerA Technical Introduction to WiredTiger
A Technical Introduction to WiredTiger
 
Sexy DIY-Badges: Mehr als Zertifikate!?
Sexy DIY-Badges: Mehr als Zertifikate!?Sexy DIY-Badges: Mehr als Zertifikate!?
Sexy DIY-Badges: Mehr als Zertifikate!?
 
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-Learning
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-LearningHorizon Report 2015: Was ist der nächste heiße Scheiß im E-Learning
Horizon Report 2015: Was ist der nächste heiße Scheiß im E-Learning
 
Powerpoint-Karaoke (Erläuterungen)
Powerpoint-Karaoke (Erläuterungen)Powerpoint-Karaoke (Erläuterungen)
Powerpoint-Karaoke (Erläuterungen)
 
Exkurs: Save the pixel
Exkurs: Save the pixelExkurs: Save the pixel
Exkurs: Save the pixel
 
3Com 7030-10136
3Com 7030-101363Com 7030-10136
3Com 7030-10136
 
What have you learned from your audience feedback?
What have you learned from your audience feedback?What have you learned from your audience feedback?
What have you learned from your audience feedback?
 

Similar to NoSQL - Hands on

Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101Will Button
 
introtomongodb
introtomongodbintrotomongodb
introtomongodbsaikiran
 
Nko workshop - node js & nosql
Nko workshop - node js & nosqlNko workshop - node js & nosql
Nko workshop - node js & nosqlSimon Su
 
mongoDB Performance
mongoDB PerformancemongoDB Performance
mongoDB PerformanceMoshe Kaplan
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesDoris Chen
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersKrzysztof Kotowicz
 
Mongodb intro
Mongodb introMongodb intro
Mongodb introchristkv
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introductionTse-Ching Ho
 
Developing node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDBDeveloping node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDBRob Tweed
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBMongoDB
 
進階使用Nodejs 淺談no sql(mongodb)
進階使用Nodejs 淺談no sql(mongodb)進階使用Nodejs 淺談no sql(mongodb)
進階使用Nodejs 淺談no sql(mongodb)Simon Su
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source codeLaurence Svekis ✔
 

Similar to NoSQL - Hands on (20)

phptut4
phptut4phptut4
phptut4
 
phptut4
phptut4phptut4
phptut4
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
An introduction to MongoDB
An introduction to MongoDBAn introduction to MongoDB
An introduction to MongoDB
 
introtomongodb
introtomongodbintrotomongodb
introtomongodb
 
Express.pdf
Express.pdfExpress.pdf
Express.pdf
 
Nko workshop - node js & nosql
Nko workshop - node js & nosqlNko workshop - node js & nosql
Nko workshop - node js & nosql
 
mongoDB Performance
mongoDB PerformancemongoDB Performance
mongoDB Performance
 
MongoDB and DynamoDB
MongoDB and DynamoDBMongoDB and DynamoDB
MongoDB and DynamoDB
 
Ajax Performance Tuning and Best Practices
Ajax Performance Tuning and Best PracticesAjax Performance Tuning and Best Practices
Ajax Performance Tuning and Best Practices
 
The emerging world of mongo db csp
The emerging world of mongo db   cspThe emerging world of mongo db   csp
The emerging world of mongo db csp
 
How do i Meet MongoDB
How do i Meet MongoDBHow do i Meet MongoDB
How do i Meet MongoDB
 
SQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developersSQL Injection: complete walkthrough (not only) for PHP developers
SQL Injection: complete walkthrough (not only) for PHP developers
 
Rails with mongodb
Rails with mongodbRails with mongodb
Rails with mongodb
 
Mongodb intro
Mongodb introMongodb intro
Mongodb intro
 
mongodb-introduction
mongodb-introductionmongodb-introduction
mongodb-introduction
 
Developing node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDBDeveloping node-mdb: a Node.js - based clone of SimpleDB
Developing node-mdb: a Node.js - based clone of SimpleDB
 
Dev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDBDev Jumpstart: Build Your First App with MongoDB
Dev Jumpstart: Build Your First App with MongoDB
 
進階使用Nodejs 淺談no sql(mongodb)
進階使用Nodejs 淺談no sql(mongodb)進階使用Nodejs 淺談no sql(mongodb)
進階使用Nodejs 淺談no sql(mongodb)
 
10 java script projects full source code
10 java script projects full source code10 java script projects full source code
10 java script projects full source code
 

More from Johannes 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-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-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 05-03 - HTML5 & JavaScript Security
2013 05-03 -  HTML5 & JavaScript Security2013 05-03 -  HTML5 & JavaScript Security
2013 05-03 - HTML5 & JavaScript SecurityJohannes 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-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGLJohannes 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-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NETJohannes Hoppe
 
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
 
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 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
 
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
 
DMDW 9. Student Presentation - Java to MySQL
DMDW 9. Student Presentation - Java to MySQLDMDW 9. Student Presentation - Java to MySQL
DMDW 9. Student Presentation - Java to MySQLJohannes Hoppe
 

More from Johannes Hoppe (20)

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-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-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 05-03 - HTML5 & JavaScript Security
2013 05-03 -  HTML5 & JavaScript Security2013 05-03 -  HTML5 & JavaScript Security
2013 05-03 - HTML5 & JavaScript Security
 
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-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL2012-09-18 - HTML5 & WebGL
2012-09-18 - HTML5 & WebGL
 
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-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET2012-01-31 NoSQL in .NET
2012-01-31 NoSQL in .NET
 
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
 
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 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
 
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)
 
DMDW 9. Student Presentation - Java to MySQL
DMDW 9. Student Presentation - Java to MySQLDMDW 9. Student Presentation - Java to MySQL
DMDW 9. Student Presentation - Java to MySQL
 

Recently uploaded

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 productivityPrincipled Technologies
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
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...Drew Madelung
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

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
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
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...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.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...
 
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...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
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
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

NoSQL - Hands on

  • 2. NoSQL MongoDB Quick Reference Cards http://www.10gen.com/reference
  • 3. “Deployment” › Standardverzeichnis erstellen: c:datadb › Server-Start: mongod.exe › Shell: mongo.exe
  • 4.
  • 5. CRUD – Create In der Shell › use WebNote › db.Notes.save( { Title: 'Mittag', Message: 'nicht vergessen‘ } ); So funktioniert der Befehl › db.Notes.save
  • 6. CRUD – Create …with a bit JavaScript 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();
  • 7. CRUD – Read Queries werden ebenso im Dokument-Stil spezifiziert › db.Notes.find(); › db.Notes.find({ Title: /Test/i }); › db.Notes.find( { "Categories.Color": "red"}).limit(1);
  • 8. CRUD – Update › db.Notes.update({Title: 'Test'}, {'$set': {Categories: []}}); › db.Notes.update({Title: 'Test'}, {'$push': { Categories: {Color: 'Red'} } });
  • 9. CRUD – Delete › db.dropDatabase(); › db.Notes.drop(); › db.Notes.remove();
  • 11. Data Import (hands-on.zip) cd dump_training mongorestore -d training -c scores scores.bson cd dump_digg mongorestore -d digg -c stories stories.bson
  • 12. Test (in the shell) use digg db.stories.findOne();
  • 13. Exercises 1. Find all scores less than 65. 2. Find the lowest quiz score. Find the highest quiz score. 3. Write a query to find all digg stories where the view count is greater than 1000. 4. Query for all digg stories whose media type is either 'news' or 'images' and where the topic name is 'Comedy’. 5. Find all digg stories where the topic name is 'Television' or the media type is 'videos'. Skip the first 5 results, and limit the result set to 10.
  • 14. CRUD – Update › use digg; › db.people.update({name: 'Smith'}, {'$set': {interests: []}}); › db.people.update({name: 'Smith'}, {'$push': {interests: ['chess']}});
  • 15. Exercises 1. Set the proper 'grade' attribute for all scores. For example, users with scores greater than 90 get an 'A.' Set the grade to ‘B’ for scores falling between 80 and 90. 2. You're being nice, so you decide to add 10 points to every score on every “final” exam whose score is lower than 60. How do you do this update?

Editor's Notes

  1. mongod.exe --dbpath c:\data\db --port 27017 --logpath c:\data\mongodb.log
  2. db.Notes.save({Title: 'Mittag', Message: 'nicht vergessen'});
  3. 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();
  4. use WebNote db.Notes.find(); db.Notes.find({Title: /Test/i }); db.Notes.find({ "Categories.Color": "red"}).limit(1); Query operators: $gt, $gte, $lt, $lte, $ne, $in, $nin, $mod, $all, $size, $exists, $type, $not, $or, $elemMatch, $where.
  5. use WebNote db.Notes.save({Title: 'Test'}); db.Notes.update({Title: 'Test'}, {'$set': {Categories: []}}); db.Notes.update({Title: 'Test'}, {'$push': {Categories: { Color: 'Red' }}}); Update Operators: $set, $unset, $inc, $push, $pushAll, $pull, $pullAll, $pop, $addToSet $push { $push : { field : value } } appends value to field $set { $set : { field : value } } sets field to value.
  6. use WebNote db.dropDatabase(); db.Notes.drop(); db.Notes.remove();
  7. cd dump_training mongorestore -d training -c scores scores.bson cd dump_digg mongorestore -d digg -c stories stories.bson
  8. use digg db.stories.findOne(); db.runCommand({listDatabases: 1}) db.getCollectionNames();
  9. Update Operators: $set, $unset, $inc, $push, $pushAll, $pull, $pullAll, $pop, $addToSet $push { $push : { field : value } } appends value to field $set { $set : { field : value } } sets field to value.