SlideShare a Scribd company logo
Back to Basics 2016: Webinar 2
Su primera aplicación MongoDB
Rubén Terceño
Senior Solutions Architect, EMEA
ruben@mongodb.com
@rubenTerceno
¡Bienvenidos!
Agenda del Curso
Date Time Webinar
25-Mayo-2016 16:00 CEST Introducción a NoSQL
7-Junio-2016 16:00 CEST Su primera aplicación MongoDB
21-Junio-2016 16:00 CEST Diseño de esquema orientado a documentos
07-Julio-2016 16:00 CEST Indexación avanzada, índices de texto y geoespaciales
19-Julio-2016 16:00 CEST Introducción al Aggregation Framework
28-Julio-2016 16:00 CEST Despliegue en producción
Resumen del webinar 1
• ¿Porqué existe NoSQL?
• Tipos de bases de datos NoSQL
• Características clave de MongoDB
• Tolerancia a fallos y persistencia de datos en MongoDB
• Escalabilidad en MongoDB
Agenda
• Vocabulario básico
• Instalación de MongoDB
• Construcción de una aplicación básica
• Creación de índices
• Optimización de queries con explain()
Concepts
Relational MongoDB
Database Database / Base de datos
Table Collection / Colección
Row Document / Documento
Index Index / Índice
Join Lookup
Foreign Key Reference / Referencia
Multi-table transaction Single document transaction
Installing MongoDB
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.6.tgz
$ tar xzvf mongodb-osx-x86_64-3.2.6.tgz
x mongodb-osx-x86_64-3.2.6/README
x mongodb-osx-x86_64-3.2.6/THIRD-PARTY-NOTICES
x mongodb-osx-x86_64-3.2.6/MPL-2
x mongodb-osx-x86_64-3.2.6/GNU-AGPL-3.0
x mongodb-osx-x86_64-3.2.6/bin/mongodump
x mongodb-osx-x86_64-3.2.6/bin/mongorestore
x mongodb-osx-x86_64-3.2.6/bin/mongoexport
x mongodb-osx-x86_64-3.2.6/bin/mongoimport
x mongodb-osx-x86_64-3.2.6/bin/mongostat
x mongodb-osx-x86_64-3.2.6/bin/mongotop
x mongodb-osx-x86_64-3.2.6/bin/bsondump
x mongodb-osx-x86_64-3.2.6/bin/mongofiles
x mongodb-osx-x86_64-3.2.6/bin/mongooplog
x mongodb-osx-x86_64-3.2.6/bin/mongoperf
x mongodb-osx-x86_64-3.2.6/bin/mongosniff
x mongodb-osx-x86_64-3.2.6/bin/mongod
x mongodb-osx-x86_64-3.2.6/bin/mongos
x mongodb-osx-x86_64-3.2.6/bin/mongo
$ mkdir /data/CB
Running Mongod
Rubens-MacBook-Pro:mongodb-osx-x86_64-3.2.6 Ruben$ ./bin/mongod -dbpath /data/CB
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] MongoDB starting : pid=21526 port=27017
dbpath=/data/CB 64-bit host=Rubens-MacBook-Pro.local
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] db version v3.2.6
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] git version:
05552b562c7a0b3143a729aaa0838e558dc49b25
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] allocator: system
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] modules: none
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] build environment:
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] distarch: x86_64
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] target_arch: x86_64
2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] options: { storage: { dbPath: "/data/CB" }
}
2016-06-05T14:44:49.565+0200 I STORAGE [initandlisten] wiredtiger_open config:
create,cache_size=9G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast)
,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=10000
0),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0),
2016-06-05T14:44:50.316+0200 I NETWORK [HostnameCanonicalizationWorker] Starting hostname
canonicalization worker
2016-06-05T14:44:50.316+0200 I FTDC [initandlisten] Initializing full-time diagnostic data
capture with directory '/data/CB/diagnostic.data'
2016-06-05T14:44:50.511+0200 I NETWORK [initandlisten] waiting for connections on port 27017
Connecting Via The Shell
Ruben$ ./mongodb-osx-x86_64-3.2.6/bin/mongo
MongoDB shell version: 3.2.6
connecting to: test
> show databases
local 0.000GB
Inserting your first record
> use CB
switched to db CB
> show databases
local 0.000GB
> db.demo.insert({"nombre": "Rubén", "altura": 178})
WriteResult({ "nInserted" : 1 })
> show databases
CB 0.000GB
local 0.000GB
> show collections
demo
> db.demo.findOne()
{
"_id" : ObjectId("575420c87a75dbb02b4f45cb"),
"nombre" : "Rubén",
"altura" : 178
}
>
Object ID
575420c87a75dbb02b4f45cb
TS------ID----PID-Count-
A Simple Blog Application
• Lets create a blogging application with:
• Articles
• Users
• Comments
15
Typical Entity Relation Diagram
In MongoDB we build organically
> use blog
switched to db blog
> db.users.insert( { "username" : ”rterceno",
"password" : "top secret", "lang" : "ES" } )
WriteResult({ "nInserted" : 1 })
> db.users.findOne()
{
"_id" : ObjectId("573afff65ee4be80385332a7"),
"username" : "rterceno",
"password" : "top secret",
"lang" : "ES"
}
How do we do this in a program?
package com.mongodb.rterceno;
import com.mongodb.MongoClient;
import com.mongodb.client.MongoCollection;
import com.mongodb.client.MongoDatabase;
import org.bson.Document;
public class Demo {
public static void main(String[] args) {
MongoClient client = new MongoClient();
MongoDatabase blog = client.getDatabase("blog");
MongoCollection<Document> users = blog.getCollection("users");
Document user = new Document("user","rterceno")
.append("lang", "ES");
users.insertOne(user);
}
}
Next up Articles
import [+]
import static java.util.Arrays.asList;
public class Demo {
public static void main(String[] args) {
MongoClient client = new MongoClient();
MongoDatabase blog = client.getDatabase("blog");
MongoCollection<Document> articulos = blog.getCollection("articles");
String myName = "rterceno";
Document articulo = new Document("título","My article")
.append("autor", myName)
.append("texto", "Lorem ipsum dolor sit amet, […] commodo consequat.")
.append("tags", asList("demo","español","MongoDB"));
articulos.insertOne(articulo);
}
}
Create a new type of article
public class Demo {
static DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"
, Locale.ENGLISH);
public static void main(String[] args) {
MongoClient client = new MongoClient();
MongoDatabase blog = client.getDatabase("blog");
MongoCollection<Document> articulos = blog.getCollection("articles");
String myName = "rterceno";
Document articulo = new Document("título","My article")
.append("autor", myName)
.append("texto", "Lorem ipsum dolor sit amet […] commodo
consequat.")
.append("tags", asList("demo", "español", "MongoDB"))
.append("fecha", new Date());
articulos.insertOne(articulo);
}
}
Make a lot of articles
public class Demo {
static DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'"
, Locale.ENGLISH);
public static void main(String[] args) {
MongoClient client = new MongoClient();
MongoDatabase blog = client.getDatabase("blog");
MongoCollection<Document> articulos = blog.getCollection("articles");
List<Document> list = new ArrayList<Document>();
for (int i=0; i<1000000; i++){
Document articulo = new Document("título”, "Mi artículo " + i)
.append("autor", "USER_" + Math.round(Math.random()*10000))
.append("texto", "Lorem ipsum dolor sit amet, […] ex ea commodo consequat.")
.append("tags", asList("demo", "español", "MongoDB"))
.append("fecha", new Date());
list.add(articulo);
if (i % 5000 == 4999){
articulos.insertMany(list);
list.clear();
}
}
}
}
Find a User
> db.users.findOne()
{
"_id" : ObjectId("5742da5bb26a88bc00e941ac"),
"username" : "FLFZQLSRWZ_0",
"lang" : "EN",
"password" : "vTlILbGWLt",
"karma" : 448
}
> db.users.find( { "username" : "VHXDAUUFJW_45" } ).pretty()
{
"_id" : ObjectId("5742da5bb26a88bc00e94206"),
"username" : "VHXDAUUFJW_45",
"lang" : "EN",
"password" : "GmRLnCeKVp",
"karma" : 284
}
Find Users with high Karma
> db.users.find( { "karma" : { $gte : 450 }} ).pretty()
{
"_id" : ObjectId("5742da5bb26a88bc00e941ae"),
"username" : "JALLFRKBWD_1",
"lang" : "EN",
"password" : "bCSKSKvUeb",
"karma" : 487
}
{
"_id" : ObjectId("5742da5bb26a88bc00e941e4"),
"username" : "OTKWJJBNBU_28",
"lang" : "EN",
"password" : "HAWpiATCBN",
"karma" : 473
}
{
Using projection
> db.users.find( { "karma" : { $gte : 450 }}, { "_id" : 0, username : 1, karma
: 1 } )
{ "username" : "JALLFRKBWD_1", "karma" : 487 }
{ "username" : "OTKWJJBNBU_28", "karma" : 473 }
{ "username" : "RVVHLKTWHU_31", "karma" : 493 }
{ "username" : "JBNESEOOEP_48", "karma" : 464 }
{ "username" : "VSTBDZLKQQ_51", "karma" : 487 }
{ "username" : "UKYDTQJCLO_61", "karma" : 493 }
{ "username" : "HZFZZMZHYB_106", "karma" : 493 }
{ "username" : "AAYLPJJNHO_113", "karma" : 455 }
{ "username" : "CXZZMHLBXE_128", "karma" : 460 }
{ "username" : "KKJXBACBVN_134", "karma" : 460 }
{ "username" : "PTNTIBGAJV_165", "karma" : 461 }
{ "username" : "PVLCQJIGDY_169", "karma" : 463 }
Using sort
> db.users.find({"karma”: {$gte: 450}},{"_id”: 0, username: 1, karma:
1}).sort({"karma”: 1})
{ "username" : "JALLFRKBWD_1", "karma" : 493 }
{ "username" : "OTKWJJBNBU_28", "karma" : 493 }
{ "username" : "RVVHLKTWHU_31", "karma" : 487 }
{ "username" : "JBNESEOOEP_48", "karma" : 474}
{ "username" : "VSTBDZLKQQ_51", "karma" : 473 }
{ "username" : "UKYDTQJCLO_61", "karma" : 468 }
{ "username" : "HZFZZMZHYB_106", "karma" : 464 }
{ "username" : "AAYLPJJNHO_113", "karma" : 461 }
{ "username" : "CXZZMHLBXE_128", "karma" : 461 }
{ "username" : "KKJXBACBVN_134", "karma" : 460 }
{ "username" : "PTNTIBGAJV_165", "karma" : 458 }
{ "username" : "PVLCQJIGDY_169", "karma" : 455 }
Article update: adding comments 1
> db.articles.find( { "_id" : 19 } ).pretty()
{
"_id" : 19,
"body" :
"nTzOofOcnHKkJxpjKAyqTTnKZMFzzkWFeXtBRuEKsctuGBgWIrEBrYdvFI
VHJWaXLUTVUXblOZZgUqWu",
"postdate" : ISODate("2016-05-23T12:02:46.830Z"),
"author" : "ASWTOMMABN_19",
"title" : "CPMaqHtAdRwLXhlUvsej"
}
> db.articles.update( { _id : 18 }, { $set : { comments :
[] }} )
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified"
: 1 })
Article update: adding comments 2
> db.articles.find( { _id :18 } ).pretty()
{
"_id" : 18,
"body" :
"KmwFSIMQGcIsRNTDBFPuclwcVJkoMcrIPwTiSZDYyatoKzeQiKvJ
kiVSrndXqrALVIYZxGpaMjucgXUV",
"postdate" : ISODate("2016-05-
23T16:04:39.497Z"),
"author" : "USER_18",
"title" : "wTLreIEyPfovEkBhJZZe",
"comments" : [ ]
}
>
Article update: adding comments 3
> db.articles.update( { _id : 18 }, { $push : { comments : { username : ”USER_123456",
comment : "Primer!" }}} )
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.articles.find( { _id :18 } ).pretty()
{
"_id" : 18,
"body" :
"KmwFSIMQGcIsRNTDBFPuclJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrndXqrALVIYZxGpaMjucgXUV",
"postdate" : ISODate("2016-05-23T16:04:39.497Z"),
"author" : "USER_18",
"title" : "wTLreIEyPfovEkBhJZZe",
"comments" : [
{
"username" : "USER_123456",
"comment" : ”Primer!"
}
]
}
Article delete
> db.articles.remove( { "_id" : 25 } )
WriteResult({ "nRemoved" : 1 })
> db.articles.remove( { "_id" : 25 } )
WriteResult({ "nRemoved" : 0 })
> db.articles.remove( { "_id" : { $lte : 5 }} )
WriteResult({ "nRemoved" : 6 })
• Deletion leaves holes
• Dropping a collection is cheaper than deleting a large collection element
by element
Remember Users and Articles
> db.users.findOne()
{
"_id" : ObjectId("57431c07b26a88bf060e10cb"),
"username" : "USER_0",
"lang" : "EN",
"password" : "kGIxPxqKGJ",
"karma" : 266
}
> db.articles.findOne()
{
"_id" : 0,
"body" :
"hvJLnrrfZQurmtjPfUWbMhaQLZjsxHXbUycmJVZTeOZesTnZtojThrebRcUoiYwivjpwG",
"postdate" : ISODate("2016-05-23T16:04:39.246Z"),
"author" : "USER_0",
"title" : "gpNIoPxpfTAxWjzAVoTJ"
}
Find a User
> db.users.find( { "username" : "USER_123456" } ).explain()
{
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "blog.users",
"indexFilterSet" : false,
"parsedQuery" : {
"username" : {
"$eq" : ”USER_123456"
}
},
"winningPlan" : {
"stage" : "COLLSCAN",
"filter" : {
"username" : {
"$eq" : ”USER_123456"
}
},
"direction" : "forward"
},
"rejectedPlans" : [ ]
} "ok" : 1
}
Find a User – Execution Stats
> db.users.find( {"username" : "USER_999999" } ).explain( "executionStats" ).executionStats
{
"executionSuccess" : true,
"nReturned" : 1,
"executionTimeMillis" : 433,
"totalKeysExamined" : 0,
"totalDocsExamined" : 1000000,
"executionStages" : {
"stage" : "COLLSCAN",
"filter" : {
"username" : {
"$eq" : "USER_999999”}
},
"nReturned" : 1,
"executionTimeMillisEstimate" : 330,
"works" : 1000002,
"advanced" : 1,
"needTime" : 1000000,
"needYield" : 0,
"saveState" : 7812,
"restoreState" : 7812,
"isEOF" : 1,
"invalidates" : 0,
"direction" : "forward",
"docsExamined" : 1000000
We need an index
> db.users.createIndex( { username : 1 } )
{
"createdCollectionAutomatically" : false,
"numIndexesBefore" : 1,
"numIndexesAfter" : 2,
"ok" : 1
}
Indexes Overview
• Parameters
• Background : Create an index in the background as opposed to locking the
database
• Unique : All keys in the collection must be unique. Duplicate key insertions will be
rejected with an error.
• Name : explicitly name an index. Otherwise the index name is selfgenerated from the
index fields.
• Deleting an Index
• db.users.dropIndex({ “username” : 1 })
• Get All the Indexes on a collection
• db.users.getIndexes()
Query Plan Execution Stages
• COLLSCAN : for a collection scan
• IXSCAN : for scanning index keys
• FETCH : for retrieving documents
• SHARD_MERGE : for merging results from shards
Add an Index
> db.users.find( {"username" : "USER_999999”}
).explain("executionStats”).executionStats
{
"executionSuccess" : true,
"nReturned" : 1,
"executionTimeMillis" : 0,
"totalKeysExamined" : 1,
"totalDocsExamined" : 1,
…
Execution Stage
"executionStages" : {
"stage" : "FETCH",
"nReturned" : 1,
"executionTimeMillisEstimate" : 0,
"docsExamined" : 1,,
"inputStage" : {
"stage" : "IXSCAN",
"nReturned" : 1,
"executionTimeMillisEstimate" : 0,
"keyPattern" : {
"username" : 1},
"indexName" : "username_1",
"indexVersion" : 1,
"direction" : "forward",
"indexBounds" : {
"username" : [
"["USER_999999", "USER_999999"]”]},
"keysExamined" : 1,
"seenInvalidated" : 0 } } }
Drivers and Frameworks
¿Qué hemos aprendido?
• Cómo crear una base de datos y una colección
• Como insertar documentos
• Cómo realizar búsquedas
• Como hacer modificaciones de los documentos existentes
• Cómo borrar documentos
• Cómo comprobar la eficiencia de una operación
• Cómo crear índices
• Cómo averiguar los índices que se utilizan en una operación
Próximo Webinar
Diseño de esquema orientado a documentos
• 21 de Junio 2016 – 16:00 CEST, 11:00 ART, 9:00
• ¡Regístrese si aún no lo ha hecho!
• Las bases de datos de documentos requieren un enfoque distinto con
respecto a la organización de los datos.
• ¡Sin normalización!  Creamos esquemas adaptados a nuestra aplicación
• Optimizaremos dichos esquemas a los patrones de acceso.
• Demostraremos que es fácil controlar estos esquemas.
• Regístrese en : https://www.mongodb.com/webinars
• Denos su opinión, por favor: back-to-basics@mongodb.com
¿Preguntas?
 Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB

More Related Content

What's hot

Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQL
MongoDB
 
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
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
MongoDB
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
MongoDB
 
MongoDB
MongoDBMongoDB
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
Back to Basics Spanish Webinar 3 - Introducción a los replica setsBack to Basics Spanish Webinar 3 - Introducción a los replica sets
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
MongoDB
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to Basics
MongoDB
 
Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
Alex Sharp
 
High Performance Applications with MongoDB
High Performance Applications with MongoDBHigh Performance Applications with MongoDB
High Performance Applications with MongoDB
MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
Wildan Maulana
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
Steven Francia
 
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
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB Application
MongoDB
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
Abhijeet Vaikar
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
Justin Smestad
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema Design
MongoDB
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
MongoDB
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentation
Murat Çakal
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
chriskite
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB
 

What's hot (20)

Introducción a NoSQL
Introducción a NoSQLIntroducción a NoSQL
Introducción a NoSQL
 
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
 
Webinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in DocumentsWebinar: Back to Basics: Thinking in Documents
Webinar: Back to Basics: Thinking in Documents
 
Back to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDBBack to Basics, webinar 2: La tua prima applicazione MongoDB
Back to Basics, webinar 2: La tua prima applicazione MongoDB
 
MongoDB
MongoDBMongoDB
MongoDB
 
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
Back to Basics Spanish Webinar 3 - Introducción a los replica setsBack to Basics Spanish Webinar 3 - Introducción a los replica sets
Back to Basics Spanish Webinar 3 - Introducción a los replica sets
 
Webinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to BasicsWebinar: Getting Started with MongoDB - Back to Basics
Webinar: Getting Started with MongoDB - Back to Basics
 
Practical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo DbPractical Ruby Projects With Mongo Db
Practical Ruby Projects With Mongo Db
 
High Performance Applications with MongoDB
High Performance Applications with MongoDBHigh Performance Applications with MongoDB
High Performance Applications with MongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive Guide
 
OSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB TutorialOSCON 2012 MongoDB Tutorial
OSCON 2012 MongoDB Tutorial
 
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
 
Back to Basics: My First MongoDB Application
Back to Basics: My First MongoDB ApplicationBack to Basics: My First MongoDB Application
Back to Basics: My First MongoDB Application
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Webinar: Schema Design
Webinar: Schema DesignWebinar: Schema Design
Webinar: Schema Design
 
Introduction to MongoDB
Introduction to MongoDBIntroduction to MongoDB
Introduction to MongoDB
 
Building web applications with mongo db presentation
Building web applications with mongo db presentationBuilding web applications with mongo db presentation
Building web applications with mongo db presentation
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDBMongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
MongoDB Days Silicon Valley: Winning the Dreamforce Hackathon with MongoDB
 

Viewers also liked

Conceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLConceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQL
MongoDB
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
MongoDB
 
Seminario web: Simplificando el uso de su base de datos con Atlas
Seminario web: Simplificando el uso de su base de datos con AtlasSeminario web: Simplificando el uso de su base de datos con Atlas
Seminario web: Simplificando el uso de su base de datos con Atlas
MongoDB
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
Alex Sharp
 
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroupsMongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB
 
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
MongoDB
 

Viewers also liked (6)

Conceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQLConceptos básicos. Seminario web 1: Introducción a NoSQL
Conceptos básicos. Seminario web 1: Introducción a NoSQL
 
Conceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producciónConceptos básicos. Seminario web 6: Despliegue de producción
Conceptos básicos. Seminario web 6: Despliegue de producción
 
Seminario web: Simplificando el uso de su base de datos con Atlas
Seminario web: Simplificando el uso de su base de datos con AtlasSeminario web: Simplificando el uso de su base de datos con Atlas
Seminario web: Simplificando el uso de su base de datos con Atlas
 
Intro To MongoDB
Intro To MongoDBIntro To MongoDB
Intro To MongoDB
 
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroupsMongoDB World 2016: Scaling MongoDB with Docker and cGroups
MongoDB World 2016: Scaling MongoDB with Docker and cGroups
 
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
Seminario Web MongoDB-Paradigma: Cree aplicaciones más escalables utilizando ...
 

Similar to Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB

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
Joe Drumgoole
 
MongoDB - Back to Basics - La tua prima Applicazione
MongoDB - Back to Basics - La tua prima ApplicazioneMongoDB - Back to Basics - La tua prima Applicazione
MongoDB - Back to Basics - La tua prima Applicazione
Massimo Brignoli
 
Back to basics Italian webinar 2 Mia prima applicazione MongoDB
Back to basics Italian webinar 2  Mia prima applicazione MongoDBBack to basics Italian webinar 2  Mia prima applicazione MongoDB
Back to basics Italian webinar 2 Mia prima applicazione MongoDB
MongoDB
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
Norberto Leite
 
Mongo+java (1)
Mongo+java (1)Mongo+java (1)
Mongo+java (1)
MongoDB
 
Back to Basics 2017 - Your First MongoDB Application
Back to Basics 2017 - Your First MongoDB ApplicationBack to Basics 2017 - Your First MongoDB Application
Back to Basics 2017 - Your First MongoDB Application
Joe Drumgoole
 
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
MongoDB
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
NexThoughts Technologies
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
mfrancis
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
Christian Baranowski
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
MongoDB
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
Will Button
 
Hands On Spring Data
Hands On Spring DataHands On Spring Data
Hands On Spring Data
Eric Bottard
 
Webinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting StartedWebinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting Started
MongoDB
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
Henrik Ingo
 
ACM BPM and elasticsearch AMIS25
ACM BPM and elasticsearch AMIS25ACM BPM and elasticsearch AMIS25
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Dropsolid
 
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
Microsoft
 
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
Carlos Sánchez Pérez
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
Ricardo Peres
 

Similar to Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB (20)

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
 
MongoDB - Back to Basics - La tua prima Applicazione
MongoDB - Back to Basics - La tua prima ApplicazioneMongoDB - Back to Basics - La tua prima Applicazione
MongoDB - Back to Basics - La tua prima Applicazione
 
Back to basics Italian webinar 2 Mia prima applicazione MongoDB
Back to basics Italian webinar 2  Mia prima applicazione MongoDBBack to basics Italian webinar 2  Mia prima applicazione MongoDB
Back to basics Italian webinar 2 Mia prima applicazione MongoDB
 
MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know MongoDB + Java - Everything you need to know
MongoDB + Java - Everything you need to know
 
Mongo+java (1)
Mongo+java (1)Mongo+java (1)
Mongo+java (1)
 
Back to Basics 2017 - Your First MongoDB Application
Back to Basics 2017 - Your First MongoDB ApplicationBack to Basics 2017 - Your First MongoDB Application
Back to Basics 2017 - Your First MongoDB Application
 
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
 
Elastic Search
Elastic SearchElastic Search
Elastic Search
 
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
OSGi and Spring Data for simple (Web) Application Development - Christian Bar...
 
OSGi and Spring Data for simple (Web) Application Development
OSGi and Spring Data  for simple (Web) Application DevelopmentOSGi and Spring Data  for simple (Web) Application Development
OSGi and Spring Data for simple (Web) Application Development
 
Fun Teaching MongoDB New Tricks
Fun Teaching MongoDB New TricksFun Teaching MongoDB New Tricks
Fun Teaching MongoDB New Tricks
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
Hands On Spring Data
Hands On Spring DataHands On Spring Data
Hands On Spring Data
 
Webinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting StartedWebinar: Build an Application Series - Session 2 - Getting Started
Webinar: Build an Application Series - Session 2 - Getting Started
 
Building Your First MongoDB App
Building Your First MongoDB AppBuilding Your First MongoDB App
Building Your First MongoDB App
 
ACM BPM and elasticsearch AMIS25
ACM BPM and elasticsearch AMIS25ACM BPM and elasticsearch AMIS25
ACM BPM and elasticsearch AMIS25
 
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and moreScaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
Scaling Drupal in AWS Using AutoScaling, Cloudformation, RDS and more
 
Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !Elasticsearch sur Azure : Make sense of your (BIG) data !
Elasticsearch sur Azure : Make sense of your (BIG) data !
 
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
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 

More from MongoDB

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB
 

More from MongoDB (20)

MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB AtlasMongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
MongoDB SoCal 2020: Migrate Anything* to MongoDB Atlas
 
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
MongoDB SoCal 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
MongoDB SoCal 2020: Using MongoDB Services in Kubernetes: Any Platform, Devel...
 
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDBMongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
MongoDB SoCal 2020: A Complete Methodology of Data Modeling for MongoDB
 
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
MongoDB SoCal 2020: From Pharmacist to Analyst: Leveraging MongoDB for Real-T...
 
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series DataMongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
MongoDB SoCal 2020: Best Practices for Working with IoT and Time-series Data
 
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 MongoDB SoCal 2020: MongoDB Atlas Jump Start MongoDB SoCal 2020: MongoDB Atlas Jump Start
MongoDB SoCal 2020: MongoDB Atlas Jump Start
 
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
MongoDB .local San Francisco 2020: Powering the new age data demands [Infosys]
 
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
MongoDB .local San Francisco 2020: Using MongoDB Services in Kubernetes: any ...
 
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
MongoDB .local San Francisco 2020: Go on a Data Safari with MongoDB Charts!
 
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your MindsetMongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
MongoDB .local San Francisco 2020: From SQL to NoSQL -- Changing Your Mindset
 
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas JumpstartMongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
MongoDB .local San Francisco 2020: MongoDB Atlas Jumpstart
 
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
MongoDB .local San Francisco 2020: Tips and Tricks++ for Querying and Indexin...
 
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
MongoDB .local San Francisco 2020: Aggregation Pipeline Power++
 
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
MongoDB .local San Francisco 2020: A Complete Methodology of Data Modeling fo...
 
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep DiveMongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
MongoDB .local San Francisco 2020: MongoDB Atlas Data Lake Technical Deep Dive
 
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & GolangMongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
MongoDB .local San Francisco 2020: Developing Alexa Skills with MongoDB & Golang
 
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
MongoDB .local Paris 2020: Realm : l'ingrédient secret pour de meilleures app...
 
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
MongoDB .local Paris 2020: Upply @MongoDB : Upply : Quand le Machine Learning...
 

Recently uploaded

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
bmucuha
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
asyed10
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
nyvan3
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
jitskeb
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
ElizabethGarrettChri
 
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
actyx
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
ytypuem
 
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
1tyxnjpia
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
ihavuls
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
dataschool1
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
Vineet
 
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
yuvarajkumar334
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
zsafxbf
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
TeukuEriSyahputra
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
hqfek
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 

Recently uploaded (20)

一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理一比一原版(UO毕业证)渥太华大学毕业证如何办理
一比一原版(UO毕业证)渥太华大学毕业证如何办理
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
一比一原版英国赫特福德大学毕业证(hertfordshire毕业证书)如何办理
 
Experts live - Improving user adoption with AI
Experts live - Improving user adoption with AIExperts live - Improving user adoption with AI
Experts live - Improving user adoption with AI
 
Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024Open Source Contributions to Postgres: The Basics POSETTE 2024
Open Source Contributions to Postgres: The Basics POSETTE 2024
 
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
一比一原版斯威本理工大学毕业证(swinburne毕业证)如何办理
 
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
一比一原版(曼大毕业证书)曼尼托巴大学毕业证如何办理
 
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
 
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCAModule 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
Module 1 ppt BIG DATA ANALYTICS NOTES FOR MCA
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
 
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
一比一原版爱尔兰都柏林大学毕业证(本硕)ucd学位证书如何办理
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 

Conceptos básicos. Seminario web 2: Su primera aplicación MongoDB

  • 1.
  • 2.
  • 3. Back to Basics 2016: Webinar 2 Su primera aplicación MongoDB Rubén Terceño Senior Solutions Architect, EMEA ruben@mongodb.com @rubenTerceno
  • 5. Agenda del Curso Date Time Webinar 25-Mayo-2016 16:00 CEST Introducción a NoSQL 7-Junio-2016 16:00 CEST Su primera aplicación MongoDB 21-Junio-2016 16:00 CEST Diseño de esquema orientado a documentos 07-Julio-2016 16:00 CEST Indexación avanzada, índices de texto y geoespaciales 19-Julio-2016 16:00 CEST Introducción al Aggregation Framework 28-Julio-2016 16:00 CEST Despliegue en producción
  • 6. Resumen del webinar 1 • ¿Porqué existe NoSQL? • Tipos de bases de datos NoSQL • Características clave de MongoDB • Tolerancia a fallos y persistencia de datos en MongoDB • Escalabilidad en MongoDB
  • 7. Agenda • Vocabulario básico • Instalación de MongoDB • Construcción de una aplicación básica • Creación de índices • Optimización de queries con explain()
  • 8. Concepts Relational MongoDB Database Database / Base de datos Table Collection / Colección Row Document / Documento Index Index / Índice Join Lookup Foreign Key Reference / Referencia Multi-table transaction Single document transaction
  • 9. Installing MongoDB $ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.2.6.tgz $ tar xzvf mongodb-osx-x86_64-3.2.6.tgz x mongodb-osx-x86_64-3.2.6/README x mongodb-osx-x86_64-3.2.6/THIRD-PARTY-NOTICES x mongodb-osx-x86_64-3.2.6/MPL-2 x mongodb-osx-x86_64-3.2.6/GNU-AGPL-3.0 x mongodb-osx-x86_64-3.2.6/bin/mongodump x mongodb-osx-x86_64-3.2.6/bin/mongorestore x mongodb-osx-x86_64-3.2.6/bin/mongoexport x mongodb-osx-x86_64-3.2.6/bin/mongoimport x mongodb-osx-x86_64-3.2.6/bin/mongostat x mongodb-osx-x86_64-3.2.6/bin/mongotop x mongodb-osx-x86_64-3.2.6/bin/bsondump x mongodb-osx-x86_64-3.2.6/bin/mongofiles x mongodb-osx-x86_64-3.2.6/bin/mongooplog x mongodb-osx-x86_64-3.2.6/bin/mongoperf x mongodb-osx-x86_64-3.2.6/bin/mongosniff x mongodb-osx-x86_64-3.2.6/bin/mongod x mongodb-osx-x86_64-3.2.6/bin/mongos x mongodb-osx-x86_64-3.2.6/bin/mongo $ mkdir /data/CB
  • 10. Running Mongod Rubens-MacBook-Pro:mongodb-osx-x86_64-3.2.6 Ruben$ ./bin/mongod -dbpath /data/CB 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] MongoDB starting : pid=21526 port=27017 dbpath=/data/CB 64-bit host=Rubens-MacBook-Pro.local 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] db version v3.2.6 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] git version: 05552b562c7a0b3143a729aaa0838e558dc49b25 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] allocator: system 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] modules: none 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] build environment: 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] distarch: x86_64 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] target_arch: x86_64 2016-06-05T14:44:49.564+0200 I CONTROL [initandlisten] options: { storage: { dbPath: "/data/CB" } } 2016-06-05T14:44:49.565+0200 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=9G,session_max=20000,eviction=(threads_max=4),config_base=false,statistics=(fast) ,log=(enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=10000 0),checkpoint=(wait=60,log_size=2GB),statistics_log=(wait=0), 2016-06-05T14:44:50.316+0200 I NETWORK [HostnameCanonicalizationWorker] Starting hostname canonicalization worker 2016-06-05T14:44:50.316+0200 I FTDC [initandlisten] Initializing full-time diagnostic data capture with directory '/data/CB/diagnostic.data' 2016-06-05T14:44:50.511+0200 I NETWORK [initandlisten] waiting for connections on port 27017
  • 11. Connecting Via The Shell Ruben$ ./mongodb-osx-x86_64-3.2.6/bin/mongo MongoDB shell version: 3.2.6 connecting to: test > show databases local 0.000GB
  • 12. Inserting your first record > use CB switched to db CB > show databases local 0.000GB > db.demo.insert({"nombre": "Rubén", "altura": 178}) WriteResult({ "nInserted" : 1 }) > show databases CB 0.000GB local 0.000GB > show collections demo > db.demo.findOne() { "_id" : ObjectId("575420c87a75dbb02b4f45cb"), "nombre" : "Rubén", "altura" : 178 } >
  • 14. A Simple Blog Application • Lets create a blogging application with: • Articles • Users • Comments
  • 16. In MongoDB we build organically > use blog switched to db blog > db.users.insert( { "username" : ”rterceno", "password" : "top secret", "lang" : "ES" } ) WriteResult({ "nInserted" : 1 }) > db.users.findOne() { "_id" : ObjectId("573afff65ee4be80385332a7"), "username" : "rterceno", "password" : "top secret", "lang" : "ES" }
  • 17. How do we do this in a program? package com.mongodb.rterceno; import com.mongodb.MongoClient; import com.mongodb.client.MongoCollection; import com.mongodb.client.MongoDatabase; import org.bson.Document; public class Demo { public static void main(String[] args) { MongoClient client = new MongoClient(); MongoDatabase blog = client.getDatabase("blog"); MongoCollection<Document> users = blog.getCollection("users"); Document user = new Document("user","rterceno") .append("lang", "ES"); users.insertOne(user); } }
  • 18. Next up Articles import [+] import static java.util.Arrays.asList; public class Demo { public static void main(String[] args) { MongoClient client = new MongoClient(); MongoDatabase blog = client.getDatabase("blog"); MongoCollection<Document> articulos = blog.getCollection("articles"); String myName = "rterceno"; Document articulo = new Document("título","My article") .append("autor", myName) .append("texto", "Lorem ipsum dolor sit amet, […] commodo consequat.") .append("tags", asList("demo","español","MongoDB")); articulos.insertOne(articulo); } }
  • 19. Create a new type of article public class Demo { static DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'" , Locale.ENGLISH); public static void main(String[] args) { MongoClient client = new MongoClient(); MongoDatabase blog = client.getDatabase("blog"); MongoCollection<Document> articulos = blog.getCollection("articles"); String myName = "rterceno"; Document articulo = new Document("título","My article") .append("autor", myName) .append("texto", "Lorem ipsum dolor sit amet […] commodo consequat.") .append("tags", asList("demo", "español", "MongoDB")) .append("fecha", new Date()); articulos.insertOne(articulo); } }
  • 20. Make a lot of articles public class Demo { static DateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'" , Locale.ENGLISH); public static void main(String[] args) { MongoClient client = new MongoClient(); MongoDatabase blog = client.getDatabase("blog"); MongoCollection<Document> articulos = blog.getCollection("articles"); List<Document> list = new ArrayList<Document>(); for (int i=0; i<1000000; i++){ Document articulo = new Document("título”, "Mi artículo " + i) .append("autor", "USER_" + Math.round(Math.random()*10000)) .append("texto", "Lorem ipsum dolor sit amet, […] ex ea commodo consequat.") .append("tags", asList("demo", "español", "MongoDB")) .append("fecha", new Date()); list.add(articulo); if (i % 5000 == 4999){ articulos.insertMany(list); list.clear(); } } } }
  • 21. Find a User > db.users.findOne() { "_id" : ObjectId("5742da5bb26a88bc00e941ac"), "username" : "FLFZQLSRWZ_0", "lang" : "EN", "password" : "vTlILbGWLt", "karma" : 448 } > db.users.find( { "username" : "VHXDAUUFJW_45" } ).pretty() { "_id" : ObjectId("5742da5bb26a88bc00e94206"), "username" : "VHXDAUUFJW_45", "lang" : "EN", "password" : "GmRLnCeKVp", "karma" : 284 }
  • 22. Find Users with high Karma > db.users.find( { "karma" : { $gte : 450 }} ).pretty() { "_id" : ObjectId("5742da5bb26a88bc00e941ae"), "username" : "JALLFRKBWD_1", "lang" : "EN", "password" : "bCSKSKvUeb", "karma" : 487 } { "_id" : ObjectId("5742da5bb26a88bc00e941e4"), "username" : "OTKWJJBNBU_28", "lang" : "EN", "password" : "HAWpiATCBN", "karma" : 473 } {
  • 23. Using projection > db.users.find( { "karma" : { $gte : 450 }}, { "_id" : 0, username : 1, karma : 1 } ) { "username" : "JALLFRKBWD_1", "karma" : 487 } { "username" : "OTKWJJBNBU_28", "karma" : 473 } { "username" : "RVVHLKTWHU_31", "karma" : 493 } { "username" : "JBNESEOOEP_48", "karma" : 464 } { "username" : "VSTBDZLKQQ_51", "karma" : 487 } { "username" : "UKYDTQJCLO_61", "karma" : 493 } { "username" : "HZFZZMZHYB_106", "karma" : 493 } { "username" : "AAYLPJJNHO_113", "karma" : 455 } { "username" : "CXZZMHLBXE_128", "karma" : 460 } { "username" : "KKJXBACBVN_134", "karma" : 460 } { "username" : "PTNTIBGAJV_165", "karma" : 461 } { "username" : "PVLCQJIGDY_169", "karma" : 463 }
  • 24. Using sort > db.users.find({"karma”: {$gte: 450}},{"_id”: 0, username: 1, karma: 1}).sort({"karma”: 1}) { "username" : "JALLFRKBWD_1", "karma" : 493 } { "username" : "OTKWJJBNBU_28", "karma" : 493 } { "username" : "RVVHLKTWHU_31", "karma" : 487 } { "username" : "JBNESEOOEP_48", "karma" : 474} { "username" : "VSTBDZLKQQ_51", "karma" : 473 } { "username" : "UKYDTQJCLO_61", "karma" : 468 } { "username" : "HZFZZMZHYB_106", "karma" : 464 } { "username" : "AAYLPJJNHO_113", "karma" : 461 } { "username" : "CXZZMHLBXE_128", "karma" : 461 } { "username" : "KKJXBACBVN_134", "karma" : 460 } { "username" : "PTNTIBGAJV_165", "karma" : 458 } { "username" : "PVLCQJIGDY_169", "karma" : 455 }
  • 25. Article update: adding comments 1 > db.articles.find( { "_id" : 19 } ).pretty() { "_id" : 19, "body" : "nTzOofOcnHKkJxpjKAyqTTnKZMFzzkWFeXtBRuEKsctuGBgWIrEBrYdvFI VHJWaXLUTVUXblOZZgUqWu", "postdate" : ISODate("2016-05-23T12:02:46.830Z"), "author" : "ASWTOMMABN_19", "title" : "CPMaqHtAdRwLXhlUvsej" } > db.articles.update( { _id : 18 }, { $set : { comments : [] }} ) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
  • 26. Article update: adding comments 2 > db.articles.find( { _id :18 } ).pretty() { "_id" : 18, "body" : "KmwFSIMQGcIsRNTDBFPuclwcVJkoMcrIPwTiSZDYyatoKzeQiKvJ kiVSrndXqrALVIYZxGpaMjucgXUV", "postdate" : ISODate("2016-05- 23T16:04:39.497Z"), "author" : "USER_18", "title" : "wTLreIEyPfovEkBhJZZe", "comments" : [ ] } >
  • 27. Article update: adding comments 3 > db.articles.update( { _id : 18 }, { $push : { comments : { username : ”USER_123456", comment : "Primer!" }}} ) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.articles.find( { _id :18 } ).pretty() { "_id" : 18, "body" : "KmwFSIMQGcIsRNTDBFPuclJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrndXqrALVIYZxGpaMjucgXUV", "postdate" : ISODate("2016-05-23T16:04:39.497Z"), "author" : "USER_18", "title" : "wTLreIEyPfovEkBhJZZe", "comments" : [ { "username" : "USER_123456", "comment" : ”Primer!" } ] }
  • 28. Article delete > db.articles.remove( { "_id" : 25 } ) WriteResult({ "nRemoved" : 1 }) > db.articles.remove( { "_id" : 25 } ) WriteResult({ "nRemoved" : 0 }) > db.articles.remove( { "_id" : { $lte : 5 }} ) WriteResult({ "nRemoved" : 6 }) • Deletion leaves holes • Dropping a collection is cheaper than deleting a large collection element by element
  • 29. Remember Users and Articles > db.users.findOne() { "_id" : ObjectId("57431c07b26a88bf060e10cb"), "username" : "USER_0", "lang" : "EN", "password" : "kGIxPxqKGJ", "karma" : 266 } > db.articles.findOne() { "_id" : 0, "body" : "hvJLnrrfZQurmtjPfUWbMhaQLZjsxHXbUycmJVZTeOZesTnZtojThrebRcUoiYwivjpwG", "postdate" : ISODate("2016-05-23T16:04:39.246Z"), "author" : "USER_0", "title" : "gpNIoPxpfTAxWjzAVoTJ" }
  • 30. Find a User > db.users.find( { "username" : "USER_123456" } ).explain() { "queryPlanner" : { "plannerVersion" : 1, "namespace" : "blog.users", "indexFilterSet" : false, "parsedQuery" : { "username" : { "$eq" : ”USER_123456" } }, "winningPlan" : { "stage" : "COLLSCAN", "filter" : { "username" : { "$eq" : ”USER_123456" } }, "direction" : "forward" }, "rejectedPlans" : [ ] } "ok" : 1 }
  • 31. Find a User – Execution Stats > db.users.find( {"username" : "USER_999999" } ).explain( "executionStats" ).executionStats { "executionSuccess" : true, "nReturned" : 1, "executionTimeMillis" : 433, "totalKeysExamined" : 0, "totalDocsExamined" : 1000000, "executionStages" : { "stage" : "COLLSCAN", "filter" : { "username" : { "$eq" : "USER_999999”} }, "nReturned" : 1, "executionTimeMillisEstimate" : 330, "works" : 1000002, "advanced" : 1, "needTime" : 1000000, "needYield" : 0, "saveState" : 7812, "restoreState" : 7812, "isEOF" : 1, "invalidates" : 0, "direction" : "forward", "docsExamined" : 1000000
  • 32. We need an index > db.users.createIndex( { username : 1 } ) { "createdCollectionAutomatically" : false, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 }
  • 33. Indexes Overview • Parameters • Background : Create an index in the background as opposed to locking the database • Unique : All keys in the collection must be unique. Duplicate key insertions will be rejected with an error. • Name : explicitly name an index. Otherwise the index name is selfgenerated from the index fields. • Deleting an Index • db.users.dropIndex({ “username” : 1 }) • Get All the Indexes on a collection • db.users.getIndexes()
  • 34. Query Plan Execution Stages • COLLSCAN : for a collection scan • IXSCAN : for scanning index keys • FETCH : for retrieving documents • SHARD_MERGE : for merging results from shards
  • 35. Add an Index > db.users.find( {"username" : "USER_999999”} ).explain("executionStats”).executionStats { "executionSuccess" : true, "nReturned" : 1, "executionTimeMillis" : 0, "totalKeysExamined" : 1, "totalDocsExamined" : 1, …
  • 36. Execution Stage "executionStages" : { "stage" : "FETCH", "nReturned" : 1, "executionTimeMillisEstimate" : 0, "docsExamined" : 1,, "inputStage" : { "stage" : "IXSCAN", "nReturned" : 1, "executionTimeMillisEstimate" : 0, "keyPattern" : { "username" : 1}, "indexName" : "username_1", "indexVersion" : 1, "direction" : "forward", "indexBounds" : { "username" : [ "["USER_999999", "USER_999999"]”]}, "keysExamined" : 1, "seenInvalidated" : 0 } } }
  • 38. ¿Qué hemos aprendido? • Cómo crear una base de datos y una colección • Como insertar documentos • Cómo realizar búsquedas • Como hacer modificaciones de los documentos existentes • Cómo borrar documentos • Cómo comprobar la eficiencia de una operación • Cómo crear índices • Cómo averiguar los índices que se utilizan en una operación
  • 39. Próximo Webinar Diseño de esquema orientado a documentos • 21 de Junio 2016 – 16:00 CEST, 11:00 ART, 9:00 • ¡Regístrese si aún no lo ha hecho! • Las bases de datos de documentos requieren un enfoque distinto con respecto a la organización de los datos. • ¡Sin normalización!  Creamos esquemas adaptados a nuestra aplicación • Optimizaremos dichos esquemas a los patrones de acceso. • Demostraremos que es fácil controlar estos esquemas. • Regístrese en : https://www.mongodb.com/webinars • Denos su opinión, por favor: back-to-basics@mongodb.com

Editor's Notes

  1. Who I am, how long have I been at MongoDB.
  2. Delighted to have you here. Hope you can make it to all the sessions. Sessions will be recorded so we can send them out afterwards so don’t worry if you miss one. If you have questions please pop them in the sidebar.
  3. This is javascript. Lazy evaluation. Databases and collections spring to life as needed.
  4. 12 byte value.