SlideShare uma empresa Scribd logo
1 de 45
Baixar para ler offline
June 20-21, 2017
Chicago, IL
Chicago, IL
MongoDB World is where the
world’s fastest growing
database community comes
to connect, explore, and
learn.
Back to Basics 2017: Webinar 2
Mi primera aplicación MongoDB
Alejandro Mancilla
Senior Solutions Architect, EMEA
alejandro.mancilla@mongodb.com
@alxmancilla
Rubén Terceño
Senior Solutions Architect, LATAM
ruben@mongodb.com
@rubenTerceno
¡Bienvenidos!
Agenda del Curso
Date Time Webinar
25-Abril-2016 16:00 CEST Introducción a NoSQL
3-Mayo-2016 16:00 CEST Mi primera aplicación MongoDB
9-Mayo-2016 16:00 CEST Introducción a los ReplicaSets
16-Mayo-2016 16:00 CEST Introducción al Sharding
16:00 CEST = 14:00 UTC = 11:00am Argentina / Uruguay = 9:30am
Venezuela/Chile = 9:00am Colombia / Ecuador / México
Resumen del webinar 1
•  ¿Por qué 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()
Vocabulario Básico
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
Document
{
name : "Alejandro Mancilla",
title : "Senior Solutions Architect",
address : {
address1 : "Insurgentes 123",
address2 : "Col. Juárez",
zipcode : "06600",
}
expertise: ["MongoDB", "Java", "Javascript" ],
employee_number : 654,
location : [ 53.34, -6.26 ]
}
MongoDB Documents are Typed
{
name : “Alejandro Mancilla”,
title : “Senior Solutions Architect”,
Address : {
address1 : “Insurgentes 123”,
address2 : “Col. Juárez”,
zipcode : “06600”,
}
expertise: [ “MongoDB”, “Java”, “Javascript” ],
employee_number : 654,
location : [ 53.34, -6.26 ]
}
Strings
Nested Document
Array
Integer
Geo-spatial Coordinates
MongoDB Drivers
http://bsonspec.org/spec.html
Installing MongoDB
$ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.4.tgz
$ tar xzvf mongodb-osx-x86_64-3.4.4.tgz
x mongodb-osx-x86_64-3.4.4/bin/mongodump
x mongodb-osx-x86_64-3.4.4/bin/mongorestore
x mongodb-osx-x86_64-3.4.4/bin/mongoexport
x mongodb-osx-x86_64-3.4.4/bin/mongoimport
x mongodb-osx-x86_64-3.4.4/bin/mongostat
x mongodb-osx-x86_64-3.4.4/bin/mongotop
x mongodb-osx-x86_64-3.4.4/bin/mongooplog
x mongodb-osx-x86_64-3.4.4/bin/mongoperf
x mongodb-osx-x86_64-3.4.4/bin/mongod
x mongodb-osx-x86_64-3.4.4/bin/mongos
x mongodb-osx-x86_64-3.4.4/bin/mongo
Running Mongod
$ mkdir ./data/
$ ./mongodb-osx-x86_64-3.4.4/bin/mongod --dbpath ./data/
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] MongoDB starting : pid=18976 port=27017 dbpath=./data/ 64-bit
host=mancilla.local
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] db version v3.4.4
…
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] build environment:
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] distarch: x86_64
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] target_arch: x86_64
2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] options: { storage: { dbPath: "./data/" } }
2017-05-01T21:41:09.170-0500 I STORAGE [initandlisten] wiredtiger_open config:
create,cache_size=7680M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=(
enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_si
ze=2GB),statistics_log=(wait=0),
…
2017-05-01T21:41:10.085-0500 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4
2017-05-01T21:41:10.086-0500 I NETWORK [thread1] waiting for connections on port 27017
2017-05-01T21:41:10.130-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:57106 #1 (1 connection now open)
Connecting Via The Shell
$ ./mongodb-osx-x86_64-3.4.4/bin/mongo
MongoDB shell version v3.4.4
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.4.4
Server has startup warnings:
2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten]
2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for
the database.
2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] ** Read and write access to data and
configuration is unrestricted.
2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten]
> show databases
admin 0.000GB
local 0.000GB
Inserting your first record
> use cb
switched to db cb
> db.demo.insert({ name : "Alejandro Mancilla", title : "Senior Solutions Architect", address : { address1 : "Insurgentes 123",
address2 : "Col. Juárez", zipcode : "06600" }, expertise: ["MongoDB", "Java", "Javascript" ], employee_number : 654, location :
[ 53.34, -6.26 ] })
WriteResult({ "nInserted" : 1 })
> show databases
admin 0.000GB
cb 0.000GB
local 0.000GB
> show collections
demo
> db.demo.findOne()
{
"_id" : ObjectId("5909591701bfa6fc636edd17"),
"name" : "Alejandro Mancilla",
"title" : "Senior Solutions Architect",
"address" : { "address1" : "Insurgentes 123", "address2" : "Col. Juárez", "zipcode" : "06600” },
"expertise" : ["MongoDB","Java","Javascript” ],
"employee_number" : 654,
"location" : [53.34,-6.26]
}
Object ID
575420c87a75dbb02b4f45cb
TS------ID----PID-Count-
A Simple Blog Application
•  Lets create a blogging application with:
•  Articles
•  Users
•  Comments
18
Typical Entity Relation Diagram
User
·Name
·Email address
Category
·Name
·URL
Comment
·Comment
·Date
·Author
Article
·Name
·Slug
·Publish date
·Text
Tag
·Name
·URL
In MongoDB we build organically
> use blog
switched to db blog
> db.users.insert( { "name" : "amancilla", "password" :
"top secret", "lang" : "ES" } )
WriteResult({ "nInserted" : 1 })
> db.users.findOne()
{
"_id" : ObjectId("5907fb58bae58ed30ba2feed"),
"name" : "amancilla",
"password" : "top secret",
"lang" : "ES"
}
How do we do this in a program?
package com.mongodb.amancilla;
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(”name",”amancilla")
.append(”password", ”top secret")
.append("lang", "ES");
users.insertOne(user);
client.close();
}
}
Make a lot of users
public class Demo {
public static void main(String[] args) {
MongoClient client = new MongoClient("localhost", 27017);
MongoDatabase blog = client.getDatabase("blog");
MongoCollection<Document> users = blog.getCollection("users");
for (int i = 0; i < 1000; i++) {
int suffix = (int)Math.round(Math.random()*12345);
Document user = new Document()
.append("name", "USER_"+suffix)
.append("password", "pass"+ suffix)
.append("lang", "ES")
.append("karma", Integer.valueOf(suffix % 500));
users.insertOne(user);
}
client.close();
}
}
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 = ”amancilla";
Document articulo = new Document(”title","My article")
.append("author", myName)
.append("text", "Lorem ipsum dolor sit amet, […] ")
.append("tags", Arrays.asList("demo",”Java","MongoDB"));
articulos.insertOne(articulo);
client.close();
}
}
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 = "amancilla";
Document articulo = new Document("title","My article")
.append("author", myName)
.append("text", "Lorem ipsum dolor sit amet […]")
.append("tags", Arrays.asList("demo", "Java", "MongoDB"))
.append("date", new Date());
articulos.insertOne(articulo);
client.close();
}
}
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(”title”, "Mi artículo " + i)
.append("author", "USER_" + Math.round(Math.random()*10000))
.append("text", "Lorem ipsum dolor sit amet, […] ex ea commodo consequat.")
.append("tags", asList("demo", "español", "MongoDB"))
.append(”date", new Date());
list.add(articulo);
if (i % 5000 == 4999){
articulos.insertMany(list);
list.clear();
}
}
client.close();
}
}
Find a User
> db.users.findOne()
{
"_id" : ObjectId("5742da5bb26a88bc00e941ac"),
"name" : "FLFZQLSRWZ_0",
"lang" : "EN",
"password" : "vTlILbGWLt",
"karma" : 448
}
> db.users.find( { "name" : "VHXDAUUFJW_45" } ).pretty()
{
"_id" : ObjectId("5742da5bb26a88bc00e94206"),
"name" : "VHXDAUUFJW_45",
"lang" : "EN",
"password" : "GmRLnCeKVp",
"karma" : 284
}
Find Users with high Karma
> db.users.find( { "karma" : { $gte : 450 }} ).pretty()
{
"_id" : ObjectId("5742da5bb26a88bc00e941ae"),
"name" : "JALLFRKBWD_1",
"lang" : "EN",
"password" : "bCSKSKvUeb",
"karma" : 487
}
{
"_id" : ObjectId("5742da5bb26a88bc00e941e4"),
"name" : "OTKWJJBNBU_28",
"lang" : "EN",
"password" : "HAWpiATCBN",
"karma" : 473
}
{
Using projection
> db.users.find( { "karma" : { $gte : 450 }}, { "_id" :
0, name : 1, karma : 1 } )
{ "name" : "USER_8973", "karma" : 473 }
{ "name" : "USER_11959", "karma" : 459 }
{ "name" : "USER_9494", "karma" : 494 }
{ "name" : "USER_482", "karma" : 482 }
{ "name" : "USER_11466", "karma" : 466 }
{ "name" : "USER_9476", "karma" : 476 }
{ "name" : "USER_11956", "karma" : 456 }
{ "name" : "USER_1954", "karma" : 454 }
Using sort
> b.users.find({"karma": {$gte: 450}},{"_id": 0, name:
1, karma: 1}).sort({"karma": 1})
{ "name" : "USER_10950", "karma" : 450 }
{ "name" : "USER_8450", "karma" : 450 }
{ "name" : "USER_10953", "karma" : 453 }
{ "name" : "USER_8953", "karma" : 453 }
{ "name" : "USER_1953", "karma" : 453 }
{ "name" : "USER_3453", "karma" : 453 }
{ "name" : "USER_1954", "karma" : 454 }
{ "name" : "USER_11454", "karma" : 454 }
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 : 19 }, { $set : { comments :
[] }} )
WriteResult({ "nMatched" : 1, "nUpserted" : 0,
"nModified" : 1 })
Article update: adding comments 2
> db.articles.find( { _id :19 } ).pretty()
{
"_id" : 19,
"body" :
"KmwFSIMQGcIsRNTDBFPuclwcVJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrn
dXqrALVIYZxGpaMjucgXUV",
"postdate" : ISODate("2016-05-23T16:04:39.497Z"),
"author" : "USER_18",
"title" : "wTLreIEyPfovEkBhJZZe",
"comments" : [ ]
}
>
Article update: adding comments 3
> db.articles.update( { _id : 19 }, { $push : { comments : { name : "USER_123", comment :
"Primer!" }}} )
WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
> db.articles.find( { _id :19 } ).pretty()
{
"_id" : 19,
"body" : "KmwFSIMQGcIsRNTDBFPuclJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrndXqrALVIYZxGpaMjucgXUV",
"postdate" : ISODate("2016-05-23T16:04:39.497Z"),
"author" : "USER_18",
"title" : "wTLreIEyPfovEkBhJZZe",
"comments" : [
{
"username" : "USER_123",
"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_123" } ).explain()
{
"queryPlanner" : {
"plannerVersion" : 1,
"namespace" : "blog.users",
"indexFilterSet" : false,
"parsedQuery" : {
"username" : {
"$eq" : ”USER_123"
}
},
"winningPlan" : {
"stage" : "COLLSCAN",
"filter" : {
"username" : {
"$eq" : ”USER_123"
}
},
"direction" : "forward"
},
"rejectedPlans" : [ ]
} "ok" : 1
}
Find a User – Execution Stats
> db.users.find( {"name" : "USER_999" } ).explain( "executionStats" ).executionStats
{
"executionSuccess" : true,
"nReturned" : 1,
"executionTimeMillis" : 433,
"totalKeysExamined" : 0,
"totalDocsExamined" : 1000000,
"executionStages" : {
"stage" : "COLLSCAN",
"filter" : {
"name" : {
"$eq" : "USER_999”}
},
"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( { name : 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({ “name” : 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( {"name" : "USER_999"} ).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_999", "USER_999"]”]},
"keysExamined" : 1,
"seenInvalidated" : 0 } } }
Drivers and Frameworks
¿Qué hemos aprendido?
• Cómo crear una base de datos y una colección
• Cómo insertar documentos
• Cómo realizar búsquedas
• Cómo 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 revisar si los índices se utilizan en una operación
Próximo Webinar
Introducción a los ReplicaSets
•  9 de Mayo 2017 – 16:00 CEST, 11:00 ART, 9:00 CDT
•  Cómo garantizar que sus datos son durables
•  Cómo recuperarse de los fallos automáticamente
•  Cómo escribir código de cliente seguro
•  Regístrese en : https://www.mongodb.com/webinars
•  Denos su opinión, por favor: back-to-basics@mongodb.com
¿Preguntas?
Back to Basics 2017: Mí primera aplicación MongoDB

Mais conteúdo relacionado

Mais procurados

Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...MongoDB
 
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 ApplicationMongoDB
 
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 MongoDBMongoDB
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation FrameworkConceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation FrameworkMongoDB
 
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 MongoDBMongoDB
 
mongoDB Performance
mongoDB PerformancemongoDB Performance
mongoDB PerformanceMoshe Kaplan
 
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 BasicsMongoDB
 
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 NoSQLMongoDB
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011rogerbodamer
 
High Performance Applications with MongoDB
High Performance Applications with MongoDBHigh Performance Applications with MongoDB
High Performance Applications with MongoDBMongoDB
 
MongoDB : The Definitive Guide
MongoDB : The Definitive GuideMongoDB : The Definitive Guide
MongoDB : The Definitive GuideWildan Maulana
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in DocumentsMongoDB
 
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101MongoDB
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...MongoDB
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators iammutex
 
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 NoSQLMongoDB
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Dbchriskite
 

Mais procurados (20)

Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
Conceptos básicos. Seminario web 4: Indexación avanzada, índices de texto y g...
 
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
 
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
 
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation FrameworkConceptos básicos. Seminario web 5: Introducción a Aggregation Framework
Conceptos básicos. Seminario web 5: Introducción a Aggregation Framework
 
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 Performance
mongoDB PerformancemongoDB Performance
mongoDB Performance
 
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
 
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
 
Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011Mongo Web Apps: OSCON 2011
Mongo Web Apps: OSCON 2011
 
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
 
Back to Basics Webinar 3: Schema Design Thinking in Documents
 Back to Basics Webinar 3: Schema Design Thinking in Documents Back to Basics Webinar 3: Schema Design Thinking in Documents
Back to Basics Webinar 3: Schema Design Thinking in Documents
 
MongoDB
MongoDBMongoDB
MongoDB
 
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
MongoDB Days Silicon Valley: Jumpstart: Ops/Admin 101
 
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
Webinar: Developing with the modern App Stack: MEAN and MERN (with Angular2 a...
 
MongoDB 101
MongoDB 101MongoDB 101
MongoDB 101
 
10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators  10 Key MongoDB Performance Indicators
10 Key MongoDB Performance Indicators
 
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
MongodbMongodb
Mongodb
 
Intro To Mongo Db
Intro To Mongo DbIntro To Mongo Db
Intro To Mongo Db
 

Semelhante a Back to Basics 2017: Mí 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 ApplicationJoe Drumgoole
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDBNorberto Leite
 
Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012sullis
 
Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesignMongoDB APAC
 
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
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHPichikaway
 
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 StartedMongoDB
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101Will Button
 
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 ApplicazioneMassimo 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 MongoDBMongoDB
 
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBLisa Roth, PMP
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...Prasoon Kumar
 
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
 
MongoDB and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Railsrfischer20
 
moma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layermoma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layerGadi Oren
 
오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with PythonIan Choi
 

Semelhante a Back to Basics 2017: Mí 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
 
Building your first app with MongoDB
Building your first app with MongoDBBuilding your first app with MongoDB
Building your first app with MongoDB
 
Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012Getting started with MongoDB and Scala - Open Source Bridge 2012
Getting started with MongoDB and Scala - Open Source Bridge 2012
 
Mongo db eveningschemadesign
Mongo db eveningschemadesignMongo db eveningschemadesign
Mongo db eveningschemadesign
 
MongoDB
MongoDBMongoDB
MongoDB
 
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
 
How to use MongoDB with CakePHP
How to use MongoDB with CakePHPHow to use MongoDB with CakePHP
How to use MongoDB with CakePHP
 
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
 
Mongoose and MongoDB 101
Mongoose and MongoDB 101Mongoose and MongoDB 101
Mongoose and MongoDB 101
 
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
 
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 Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN StackMongoDB Days Silicon Valley: Building Applications with the MEAN Stack
MongoDB Days Silicon Valley: Building Applications with the MEAN Stack
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDBMongoDB .local London 2019: Fast Machine Learning Development with MongoDB
MongoDB .local London 2019: Fast Machine Learning Development with MongoDB
 
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
MongoDB Introduction talk at Dr Dobbs Conference, MongoDB Evenings at Bangalo...
 
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 and Ruby on Rails
MongoDB and Ruby on RailsMongoDB and Ruby on Rails
MongoDB and Ruby on Rails
 
moma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layermoma-django overview --> Django + MongoDB: building a custom ORM layer
moma-django overview --> Django + MongoDB: building a custom ORM layer
 
오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python오픈 소스 프로그래밍 - NoSQL with Python
오픈 소스 프로그래밍 - NoSQL with Python
 

Mais de 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 AtlasMongoDB
 
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 MongoDBMongoDB
 
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 DataMongoDB
 
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 StartMongoDB
 
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.2MongoDB
 
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 MindsetMongoDB
 
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 JumpstartMongoDB
 
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 DiveMongoDB
 
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 & GolangMongoDB
 
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
 

Mais de 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...
 

Último

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentationvaddepallysandeep122
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odishasmiwainfosol
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Velvetech LLC
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfLivetecs LLC
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...OnePlan Solutions
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 

Último (20)

PREDICTING RIVER WATER QUALITY ppt presentation
PREDICTING  RIVER  WATER QUALITY  ppt presentationPREDICTING  RIVER  WATER QUALITY  ppt presentation
PREDICTING RIVER WATER QUALITY ppt presentation
 
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company OdishaBalasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
Balasore Best It Company|| Top 10 IT Company || Balasore Software company Odisha
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...Software Project Health Check: Best Practices and Techniques for Your Product...
Software Project Health Check: Best Practices and Techniques for Your Product...
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
How to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdfHow to Track Employee Performance A Comprehensive Guide.pdf
How to Track Employee Performance A Comprehensive Guide.pdf
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
Maximizing Efficiency and Profitability with OnePlan’s Professional Service A...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 

Back to Basics 2017: Mí primera aplicación MongoDB

  • 1.
  • 2. June 20-21, 2017 Chicago, IL Chicago, IL MongoDB World is where the world’s fastest growing database community comes to connect, explore, and learn.
  • 3. Back to Basics 2017: Webinar 2 Mi primera aplicación MongoDB Alejandro Mancilla Senior Solutions Architect, EMEA alejandro.mancilla@mongodb.com @alxmancilla Rubén Terceño Senior Solutions Architect, LATAM ruben@mongodb.com @rubenTerceno
  • 5. Agenda del Curso Date Time Webinar 25-Abril-2016 16:00 CEST Introducción a NoSQL 3-Mayo-2016 16:00 CEST Mi primera aplicación MongoDB 9-Mayo-2016 16:00 CEST Introducción a los ReplicaSets 16-Mayo-2016 16:00 CEST Introducción al Sharding 16:00 CEST = 14:00 UTC = 11:00am Argentina / Uruguay = 9:30am Venezuela/Chile = 9:00am Colombia / Ecuador / México
  • 6. Resumen del webinar 1 •  ¿Por qué 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. Vocabulario Básico 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. Document { name : "Alejandro Mancilla", title : "Senior Solutions Architect", address : { address1 : "Insurgentes 123", address2 : "Col. Juárez", zipcode : "06600", } expertise: ["MongoDB", "Java", "Javascript" ], employee_number : 654, location : [ 53.34, -6.26 ] }
  • 10. MongoDB Documents are Typed { name : “Alejandro Mancilla”, title : “Senior Solutions Architect”, Address : { address1 : “Insurgentes 123”, address2 : “Col. Juárez”, zipcode : “06600”, } expertise: [ “MongoDB”, “Java”, “Javascript” ], employee_number : 654, location : [ 53.34, -6.26 ] } Strings Nested Document Array Integer Geo-spatial Coordinates
  • 12. Installing MongoDB $ curl -O https://fastdl.mongodb.org/osx/mongodb-osx-x86_64-3.4.4.tgz $ tar xzvf mongodb-osx-x86_64-3.4.4.tgz x mongodb-osx-x86_64-3.4.4/bin/mongodump x mongodb-osx-x86_64-3.4.4/bin/mongorestore x mongodb-osx-x86_64-3.4.4/bin/mongoexport x mongodb-osx-x86_64-3.4.4/bin/mongoimport x mongodb-osx-x86_64-3.4.4/bin/mongostat x mongodb-osx-x86_64-3.4.4/bin/mongotop x mongodb-osx-x86_64-3.4.4/bin/mongooplog x mongodb-osx-x86_64-3.4.4/bin/mongoperf x mongodb-osx-x86_64-3.4.4/bin/mongod x mongodb-osx-x86_64-3.4.4/bin/mongos x mongodb-osx-x86_64-3.4.4/bin/mongo
  • 13. Running Mongod $ mkdir ./data/ $ ./mongodb-osx-x86_64-3.4.4/bin/mongod --dbpath ./data/ 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] MongoDB starting : pid=18976 port=27017 dbpath=./data/ 64-bit host=mancilla.local 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] db version v3.4.4 … 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] build environment: 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] distarch: x86_64 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] target_arch: x86_64 2017-05-01T21:41:09.169-0500 I CONTROL [initandlisten] options: { storage: { dbPath: "./data/" } } 2017-05-01T21:41:09.170-0500 I STORAGE [initandlisten] wiredtiger_open config: create,cache_size=7680M,session_max=20000,eviction=(threads_min=4,threads_max=4),config_base=false,statistics=(fast),log=( enabled=true,archive=true,path=journal,compressor=snappy),file_manager=(close_idle_time=100000),checkpoint=(wait=60,log_si ze=2GB),statistics_log=(wait=0), … 2017-05-01T21:41:10.085-0500 I COMMAND [initandlisten] setting featureCompatibilityVersion to 3.4 2017-05-01T21:41:10.086-0500 I NETWORK [thread1] waiting for connections on port 27017 2017-05-01T21:41:10.130-0500 I NETWORK [thread1] connection accepted from 127.0.0.1:57106 #1 (1 connection now open)
  • 14. Connecting Via The Shell $ ./mongodb-osx-x86_64-3.4.4/bin/mongo MongoDB shell version v3.4.4 connecting to: mongodb://127.0.0.1:27017 MongoDB server version: 3.4.4 Server has startup warnings: 2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] 2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database. 2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted. 2017-05-01T21:41:09.668-0500 I CONTROL [initandlisten] > show databases admin 0.000GB local 0.000GB
  • 15. Inserting your first record > use cb switched to db cb > db.demo.insert({ name : "Alejandro Mancilla", title : "Senior Solutions Architect", address : { address1 : "Insurgentes 123", address2 : "Col. Juárez", zipcode : "06600" }, expertise: ["MongoDB", "Java", "Javascript" ], employee_number : 654, location : [ 53.34, -6.26 ] }) WriteResult({ "nInserted" : 1 }) > show databases admin 0.000GB cb 0.000GB local 0.000GB > show collections demo > db.demo.findOne() { "_id" : ObjectId("5909591701bfa6fc636edd17"), "name" : "Alejandro Mancilla", "title" : "Senior Solutions Architect", "address" : { "address1" : "Insurgentes 123", "address2" : "Col. Juárez", "zipcode" : "06600” }, "expertise" : ["MongoDB","Java","Javascript” ], "employee_number" : 654, "location" : [53.34,-6.26] }
  • 17. A Simple Blog Application •  Lets create a blogging application with: •  Articles •  Users •  Comments
  • 18. 18 Typical Entity Relation Diagram User ·Name ·Email address Category ·Name ·URL Comment ·Comment ·Date ·Author Article ·Name ·Slug ·Publish date ·Text Tag ·Name ·URL
  • 19. In MongoDB we build organically > use blog switched to db blog > db.users.insert( { "name" : "amancilla", "password" : "top secret", "lang" : "ES" } ) WriteResult({ "nInserted" : 1 }) > db.users.findOne() { "_id" : ObjectId("5907fb58bae58ed30ba2feed"), "name" : "amancilla", "password" : "top secret", "lang" : "ES" }
  • 20. How do we do this in a program? package com.mongodb.amancilla; 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(”name",”amancilla") .append(”password", ”top secret") .append("lang", "ES"); users.insertOne(user); client.close(); } }
  • 21. Make a lot of users public class Demo { public static void main(String[] args) { MongoClient client = new MongoClient("localhost", 27017); MongoDatabase blog = client.getDatabase("blog"); MongoCollection<Document> users = blog.getCollection("users"); for (int i = 0; i < 1000; i++) { int suffix = (int)Math.round(Math.random()*12345); Document user = new Document() .append("name", "USER_"+suffix) .append("password", "pass"+ suffix) .append("lang", "ES") .append("karma", Integer.valueOf(suffix % 500)); users.insertOne(user); } client.close(); } }
  • 22. 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 = ”amancilla"; Document articulo = new Document(”title","My article") .append("author", myName) .append("text", "Lorem ipsum dolor sit amet, […] ") .append("tags", Arrays.asList("demo",”Java","MongoDB")); articulos.insertOne(articulo); client.close(); } }
  • 23. 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 = "amancilla"; Document articulo = new Document("title","My article") .append("author", myName) .append("text", "Lorem ipsum dolor sit amet […]") .append("tags", Arrays.asList("demo", "Java", "MongoDB")) .append("date", new Date()); articulos.insertOne(articulo); client.close(); } }
  • 24. 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(”title”, "Mi artículo " + i) .append("author", "USER_" + Math.round(Math.random()*10000)) .append("text", "Lorem ipsum dolor sit amet, […] ex ea commodo consequat.") .append("tags", asList("demo", "español", "MongoDB")) .append(”date", new Date()); list.add(articulo); if (i % 5000 == 4999){ articulos.insertMany(list); list.clear(); } } client.close(); } }
  • 25. Find a User > db.users.findOne() { "_id" : ObjectId("5742da5bb26a88bc00e941ac"), "name" : "FLFZQLSRWZ_0", "lang" : "EN", "password" : "vTlILbGWLt", "karma" : 448 } > db.users.find( { "name" : "VHXDAUUFJW_45" } ).pretty() { "_id" : ObjectId("5742da5bb26a88bc00e94206"), "name" : "VHXDAUUFJW_45", "lang" : "EN", "password" : "GmRLnCeKVp", "karma" : 284 }
  • 26. Find Users with high Karma > db.users.find( { "karma" : { $gte : 450 }} ).pretty() { "_id" : ObjectId("5742da5bb26a88bc00e941ae"), "name" : "JALLFRKBWD_1", "lang" : "EN", "password" : "bCSKSKvUeb", "karma" : 487 } { "_id" : ObjectId("5742da5bb26a88bc00e941e4"), "name" : "OTKWJJBNBU_28", "lang" : "EN", "password" : "HAWpiATCBN", "karma" : 473 } {
  • 27. Using projection > db.users.find( { "karma" : { $gte : 450 }}, { "_id" : 0, name : 1, karma : 1 } ) { "name" : "USER_8973", "karma" : 473 } { "name" : "USER_11959", "karma" : 459 } { "name" : "USER_9494", "karma" : 494 } { "name" : "USER_482", "karma" : 482 } { "name" : "USER_11466", "karma" : 466 } { "name" : "USER_9476", "karma" : 476 } { "name" : "USER_11956", "karma" : 456 } { "name" : "USER_1954", "karma" : 454 }
  • 28. Using sort > b.users.find({"karma": {$gte: 450}},{"_id": 0, name: 1, karma: 1}).sort({"karma": 1}) { "name" : "USER_10950", "karma" : 450 } { "name" : "USER_8450", "karma" : 450 } { "name" : "USER_10953", "karma" : 453 } { "name" : "USER_8953", "karma" : 453 } { "name" : "USER_1953", "karma" : 453 } { "name" : "USER_3453", "karma" : 453 } { "name" : "USER_1954", "karma" : 454 } { "name" : "USER_11454", "karma" : 454 }
  • 29. 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 : 19 }, { $set : { comments : [] }} ) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 })
  • 30. Article update: adding comments 2 > db.articles.find( { _id :19 } ).pretty() { "_id" : 19, "body" : "KmwFSIMQGcIsRNTDBFPuclwcVJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrn dXqrALVIYZxGpaMjucgXUV", "postdate" : ISODate("2016-05-23T16:04:39.497Z"), "author" : "USER_18", "title" : "wTLreIEyPfovEkBhJZZe", "comments" : [ ] } >
  • 31. Article update: adding comments 3 > db.articles.update( { _id : 19 }, { $push : { comments : { name : "USER_123", comment : "Primer!" }}} ) WriteResult({ "nMatched" : 1, "nUpserted" : 0, "nModified" : 1 }) > db.articles.find( { _id :19 } ).pretty() { "_id" : 19, "body" : "KmwFSIMQGcIsRNTDBFPuclJkoMcrIPwTiSZDYyatoKzeQiKvJkiVSrndXqrALVIYZxGpaMjucgXUV", "postdate" : ISODate("2016-05-23T16:04:39.497Z"), "author" : "USER_18", "title" : "wTLreIEyPfovEkBhJZZe", "comments" : [ { "username" : "USER_123", "comment" : ”Primer!" } ] }
  • 32. 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
  • 33. 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" }
  • 34. Find a User > db.users.find( { "username" : "USER_123" } ).explain() { "queryPlanner" : { "plannerVersion" : 1, "namespace" : "blog.users", "indexFilterSet" : false, "parsedQuery" : { "username" : { "$eq" : ”USER_123" } }, "winningPlan" : { "stage" : "COLLSCAN", "filter" : { "username" : { "$eq" : ”USER_123" } }, "direction" : "forward" }, "rejectedPlans" : [ ] } "ok" : 1 }
  • 35. Find a User – Execution Stats > db.users.find( {"name" : "USER_999" } ).explain( "executionStats" ).executionStats { "executionSuccess" : true, "nReturned" : 1, "executionTimeMillis" : 433, "totalKeysExamined" : 0, "totalDocsExamined" : 1000000, "executionStages" : { "stage" : "COLLSCAN", "filter" : { "name" : { "$eq" : "USER_999”} }, "nReturned" : 1, "executionTimeMillisEstimate" : 330, "works" : 1000002, "advanced" : 1, "needTime" : 1000000, "needYield" : 0, "saveState" : 7812, "restoreState" : 7812, "isEOF" : 1, "invalidates" : 0, "direction" : "forward", "docsExamined" : 1000000
  • 36. We need an index > db.users.createIndex( { name : 1 } ) { "createdCollectionAutomatically" : false, "numIndexesBefore" : 1, "numIndexesAfter" : 2, "ok" : 1 }
  • 37. 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({ “name” : 1 }) •  Get All the Indexes on a collection •  db.users.getIndexes()
  • 38. 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
  • 39. Add an Index > db.users.find( {"name" : "USER_999"} ).explain("executionStats").executionStats { "executionSuccess" : true, "nReturned" : 1, "executionTimeMillis" : 0, "totalKeysExamined" : 1, "totalDocsExamined" : 1, …
  • 40. 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_999", "USER_999"]”]}, "keysExamined" : 1, "seenInvalidated" : 0 } } }
  • 42. ¿Qué hemos aprendido? • Cómo crear una base de datos y una colección • Cómo insertar documentos • Cómo realizar búsquedas • Cómo 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 revisar si los índices se utilizan en una operación
  • 43. Próximo Webinar Introducción a los ReplicaSets •  9 de Mayo 2017 – 16:00 CEST, 11:00 ART, 9:00 CDT •  Cómo garantizar que sus datos son durables •  Cómo recuperarse de los fallos automáticamente •  Cómo escribir código de cliente seguro •  Regístrese en : https://www.mongodb.com/webinars •  Denos su opinión, por favor: back-to-basics@mongodb.com