CC5212-1 Procesamiento Masivo de...
Transcript of CC5212-1 Procesamiento Masivo de...
![Page 1: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/1.jpg)
CC5212-1PROCESAMIENTO MASIVO DE DATOS
OTOÑO 2018
Lecture 9NoSQL: MongoDB
Aidan Hogan
![Page 2: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/2.jpg)
NoSQL
![Page 3: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/3.jpg)
http://db-engines.com/en/ranking
![Page 4: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/4.jpg)
DOCUMENT STORES
![Page 5: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/5.jpg)
Key–Value: a Distributed MapCountries
Primary Key Value
Afghanistan capital:Kabul,continent:Asia,pop:31108077#2011
… …
Tabular: Multi-dimensional Maps Countries
Primary Key capital continent pop-value pop-year
Afghanistan Kabul Asia 31108077 2011
… … … … …
Document: Value is a documentCountries
Primary Key Value
Afghanistan { cap: “Kabul”, con: “Asia”, pop: { val: 31108077, y: 2011 } }
… …
![Page 6: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/6.jpg)
![Page 7: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/7.jpg)
![Page 8: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/8.jpg)
http://cryto.net/~joepie91/blog/2015/07/19/why-you-should-never-ever-ever-use-mongodb/
![Page 9: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/9.jpg)
MONGODB: DATA MODEL
![Page 10: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/10.jpg)
JavaScript Object Notation: JSON
![Page 11: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/11.jpg)
Binary JSON: BSON
![Page 12: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/12.jpg)
MongoDB: Datatypes
![Page 13: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/13.jpg)
MongoDB: Map from keys to BSON values
TVSeries
Key BSON Value
99a88b77c66d
… …
![Page 14: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/14.jpg)
TVSeries
Key BSON Value
99a88b77c66d
11f22e33d44c
MongoDB Collection: Similar Documents
![Page 15: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/15.jpg)
database: TV
MongoDB Database: Related Collections
TVEpisodes
Key BSON Value
… …
TVNetworks
Key BSON Value
… …
TVSeries
Key BSON Value
… …
![Page 16: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/16.jpg)
Load database (and create if not exists):
See all (non-empty) databases ( is empty):
See current database:
Drop current database:
![Page 17: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/17.jpg)
Create collection :
See all collections in current database:
Drop collection :
Clear all documents from collection :
![Page 18: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/18.jpg)
Create capped collection (keeps only most recent):
Create collection with default index on :
![Page 19: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/19.jpg)
MONGODB: INSERTING DATA
![Page 20: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/20.jpg)
Insert document: without
![Page 21: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/21.jpg)
Insert document: with
… fails if _id already exists… use or to update existing document(s)
![Page 22: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/22.jpg)
Use and to overwrite:
… overwrites old document
![Page 23: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/23.jpg)
MONGODB: QUERIES WITH SELECTION
![Page 24: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/24.jpg)
Query documents in a collection with :
… use to return one document
![Page 25: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/25.jpg)
Pretty print results with :
![Page 26: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/26.jpg)
Selection: find documents matching σ
σ
![Page 27: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/27.jpg)
Selection σ: Equality
Equality:
Results would include but for brevity, we will omitthis from examples where it is not important.
![Page 28: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/28.jpg)
Selection σ: Nested key
Key can access nested values:
![Page 29: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/29.jpg)
Selection σ: Equality on
Equality on nested null value:
… matches when value is null or ...
![Page 30: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/30.jpg)
Selection σ: Equality on
Key can access nested values:
… when field doesn't exist with .
![Page 31: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/31.jpg)
Selection σ: Equality on document
Value can be an object/document:
![Page 32: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/32.jpg)
Selection σ: Equality on document
Value can be an object/document:
… no results: needs to match full object.
![Page 33: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/33.jpg)
Selection σ: Equality on document
Value can be an object/document:
… no results: order of attributes matters.
![Page 34: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/34.jpg)
Selection σ: Equality on exact array
Equality can match an exact array:
![Page 35: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/35.jpg)
Selection σ: Equality on exact array
Equality can match an exact array
… no results: needs to match full array.
![Page 36: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/36.jpg)
Selection σ: Equality on exact array
Equality can match an exact array
… no results: order of elements matters.
![Page 37: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/37.jpg)
Selection σ: Equality matches inside array
Equality matches a value in an array:
![Page 38: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/38.jpg)
Selection σ: Equality matches both
Equality matches a value inside and outside an array:
*cough*
![Page 39: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/39.jpg)
Selection σ: Inequalities
Less than:
Greater than:
Less than or equal:
Greater than or equal:
Not equals:
![Page 40: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/40.jpg)
Selection σ: Less Than
Less than:
![Page 41: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/41.jpg)
Selection σ: Match one of multiple values
Match any value:
… also passes if key does not exist.
Match no value:
![Page 42: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/42.jpg)
Selection σ: Match one of multiple values
Match any value:
![Page 43: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/43.jpg)
Selection σ: Match one of multiple values
Match any value:
… if key references an array, any value of array should match any value of
![Page 44: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/44.jpg)
Selection σ: Boolean connectives
And: σ σ′
Or: σ σ′
Not: σ
Nor: σ σ′
… of course, can nest such conditions
![Page 45: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/45.jpg)
Selection σ: And
And: σ σ′
![Page 46: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/46.jpg)
Selection σ: Attribute (not) exists
Exists:
Not Exists:
![Page 47: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/47.jpg)
Selection σ: Attribute exists
Exists:
… checks that the field exists(even if value is )
![Page 48: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/48.jpg)
Selection σ: Attribute not exists
Not exists:
… checks that the field doesn’t exist(empty results)
![Page 49: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/49.jpg)
Selection σ: Arrays
All:
Match one: σ σ
Size:
![Page 50: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/50.jpg)
Selection σ: Array contains (at least) all elements
All:
… all values are in the array
![Page 51: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/51.jpg)
Selection σ: Array element matches (with AND)
Match one: σ σ
… one element matches all criteria (with AND)
![Page 52: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/52.jpg)
Selection σ: Array with exact size
Size:
… only possible for exact size of array (not ranges)
![Page 53: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/53.jpg)
Selection σ: Type of value
Type:
![Page 54: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/54.jpg)
Selection σ: Type of value
Type:
![Page 55: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/55.jpg)
Selection σ: Matching an array by type?
Type:
… empty… passes if any value in the array has that type
![Page 56: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/56.jpg)
https://docs.mongodb.com/manual/reference/operator/query/type/
Selection σ: Matching an array by type?
![Page 57: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/57.jpg)
https://docs.mongodb.com/manual/reference/operator/query/type/
Selection σ: Matching an array by type?
![Page 58: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/58.jpg)
![Page 59: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/59.jpg)
Selection σ: Other operators
Mod:
Regex:
Text search:
Where (JS):
… is executed over all documents(and should be avoided where possible)
![Page 60: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/60.jpg)
Selection σ: Geographic features
https://docs.mongodb.com/manual/reference/operator/query-geospatial/
![Page 61: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/61.jpg)
Selection σ: Bitwise features
https://docs.mongodb.com/manual/reference/operator/query-bitwise/
![Page 62: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/62.jpg)
MONGODB: PROJECTION OF OUTPUT VALUES
![Page 63: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/63.jpg)
Projection π: Choose output values
: Output field(s) with : Suppress field(s) with
Project first matching array element I: Project first matching array element II
: Output first or last array values
https://docs.mongodb.com/manual/reference/operator/projection/
![Page 64: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/64.jpg)
Projection π: Output certain fields
Project only certain fields:
… outputs what is available; by default also outputs field
![Page 65: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/65.jpg)
Projection π: Output embedded fields
Project (embedded) fields:
… field is still nested in output
![Page 66: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/66.jpg)
Projection π: Output embedded fields in array
Project (embedded) fields:
… projects from within the array.
![Page 67: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/67.jpg)
Projection π: Suppress certain fields
Return all but certain fields:
… cannot combine and except ...
![Page 68: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/68.jpg)
Projection π: Suppress certain fields
Suppress ID:
… suppresses when other fields are output
![Page 69: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/69.jpg)
Projection π: Output first matching element
Project first matching element:
![Page 70: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/70.jpg)
Projection π: Output first matching element
Project first matching element:
… allows to separate selection and projection criteria.
![Page 71: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/71.jpg)
Projection π: Output first matching element
Project first matching element:
… drops array field entirely if no element is projected.
![Page 72: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/72.jpg)
Projection π: Output first matching element
Project first matching element:
… can match on array of documents.
![Page 73: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/73.jpg)
Projection π: Output some matching elements
Return first elements: (where > 0)
![Page 74: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/74.jpg)
Projection π: Output some matching elements
Return last elements: (where < 0)
![Page 75: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/75.jpg)
Projection π: Output some matching elements
Skip and return : ( , > 0)
![Page 76: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/76.jpg)
Projection π: Output some matching elements
From last , return : ( < 0, > 0)
![Page 77: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/77.jpg)
MONGODB: UPDATES
![Page 78: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/78.jpg)
Update u: Modify fields in documents
: Set the value: Remove the key and value
: Rename the field (change the key): You don't want to know
: Increment number by : Multiply number by : Replace values less than by : Replace values greater than by
: Set to current date
https://docs.mongodb.com/manual/reference/operator/update-field/
![Page 79: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/79.jpg)
Use with query criteria and update criteria:
![Page 80: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/80.jpg)
Update u: Modify arrays in documents
: Adds value if not already present: Deletes first or last value
: Appends (an) item(s) to the array: Removes values from a list
: Removes values that match a condition
(Sub-)operators used for pushing/adding values:: Select first element matching query condition
: Add or push multiple values: After pushing, keep first or last values
: Sort the array after pushing: Push values to a specific array index
https://docs.mongodb.com/manual/reference/operator/update-array/
![Page 81: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/81.jpg)
Update u: Modify arrays in documents
![Page 82: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/82.jpg)
Update u: Modify arrays in documents
![Page 83: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/83.jpg)
Update u: Modify arrays in documents
![Page 84: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/84.jpg)
MONGODB: AGGREGATION AND PIPELINES
![Page 85: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/85.jpg)
Aggregation: without grouping
: Array of unique values for that key
: Count the documentshttps://docs.mongodb.com/manual/reference/method/db.collection.count/
https://docs.mongodb.com/manual/reference/method/db.collection.distinct/
![Page 86: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/86.jpg)
Aggregation:
![Page 87: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/87.jpg)
Pipelines: Transforming Collections
https://docs.mongodb.com/manual/reference/operator/aggregation/
stage1 stage2 stageN-1
![Page 88: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/88.jpg)
Pipeline ρ: Stage Operators: Filter by selection criteria σ
: Perform a projection π
: Group documents by a key/value
[used with , , , , , , etc.]
: Perform left-outer-join with another collection
: Copy each document for each array value
: Get statistics about collection
: Count the documents in the collection
: Sort documents by a given key ( | )
: Return (up to) first documents
: Return (up to) sampled documents
: Skip n documents
: Save collection to MongoDB
(more besides)
https://docs.mongodb.com/manual/reference/operator/aggregation/
![Page 89: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/89.jpg)
Pipeline Aggregation: and
![Page 90: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/90.jpg)
Pipeline Aggregation:
![Page 91: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/91.jpg)
Pipeline Aggregation:
![Page 92: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/92.jpg)
MONGODB:INDEXING
![Page 93: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/93.jpg)
MongoDB Indexing
Per collection:
• Index
• Single-field Index (sorted)
• Compound Index (sorted)
• Multikey Index (for arrays)
• Geospatial Index
• Full-text Index
• Hash-based indexing (hashed)
![Page 94: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/94.jpg)
MongoDB: Text Indexing Example
![Page 95: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/95.jpg)
MongoDB: Text Indexing Example
![Page 96: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/96.jpg)
MONGODB:DISTRIBUTION
![Page 97: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/97.jpg)
MongoDB: Distribution
• "Sharding":
– Hash-based or Horizontal Ranged
(Depends on indexes)
• Replication
– Replica sets
![Page 98: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/98.jpg)
![Page 99: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/99.jpg)
MONGODB:WHY IS IT SO POPULAR?
![Page 100: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/100.jpg)
http://db-engines.com/en/ranking
![Page 101: CC5212-1 Procesamiento Masivo de Datosaidanhogan.com/teaching/cc5212-1-2018/lectures/MDP2018-09.pdfCC5212-1 PROCESAMIENTO MASIVO DE DATOS OTOÑO 2018 Lecture 9 NoSQL: MongoDB Aidan](https://reader033.fdocuments.in/reader033/viewer/2022060916/60a93c70859235784c77d597/html5/thumbnails/101.jpg)
Questions?