Some cool features of MongoDB
-
Upload
tugdual-grall -
Category
Technology
-
view
296 -
download
0
description
Transcript of Some cool features of MongoDB
![Page 1: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/1.jpg)
Technical Evangelist, MongoDB@tgrall
Tugdual Grall
@EspritJUG
Some cool features of MongoDB
![Page 3: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/3.jpg)
Real Time Analytics
![Page 4: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/4.jpg)
State
• We're storing our data in MongoDB
• We need to do ad-hoc reporting, grouping, common aggregations, etc.
• What are we using for this?
![Page 6: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/6.jpg)
Data Warehousing
• SQL for reporting and analytics
• Infrastructure complications
• Additional maintenance
• Data duplication
• ETL processes
• Real time?
![Page 8: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/8.jpg)
Aggregation Framework
• Declared in JSON, executes in C++
• Flexible, functional, and simple
• Operation pipeline
• Computational expressions
• Plays nice with sharding
![Page 9: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/9.jpg)
Pipeline
• Process a stream of documents
• Original input is a collection
• Final output is a result document
• Series of operators
• Filter or transform data
• Input/output chain
![Page 12: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/12.jpg)
Search…
![Page 15: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/15.jpg)
MongoDB Full Text Search
• Turnkey search for apps
• Lowest cost
• Simplest ops
• Multi Language Support
![Page 16: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/16.jpg)
GeoSpatial
![Page 17: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/17.jpg)
• Store Geographical Informations
• … and query them!
GeoSpatial
![Page 18: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/18.jpg)
How do you store information?
http://geojson.org/
![Page 19: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/19.jpg)
Point
{!! "loc" : !! ! {!! ! ! "type" : "Point",!! ! ! "coordinates" : [1.4528388, 43.5956005] !! ! }!}
![Page 20: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/20.jpg)
LineString{!! "loc" : !! ! {!! ! ! "type" : "LineString",!! ! ! "coordinates" : [ [1.4528388, 43.5956005], ! ! ! ! ! ! ! [1.3996881, 43.5976828] ] !! ! }!}
![Page 21: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/21.jpg)
Polygon{"loc" : !! ! { "type" : "Polygon",!! ! ! "coordinates" : [! [1.4528388, 43.5956005],!! ! ! ! ! ! ! ! [1.3996881, 43.5976828],! ! ! ! ! ! ! ! ! [1.4001065, 43.6364262],!! ! ! ! ! ! ! ! [1.4518624, 43.6324835],! ! ! ! ! ! ! ![1.4528388, 43.5956005] ] !! ! }!}
![Page 24: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/24.jpg)
Near a pointdb.points.find(
{ "loc" :{$near : {$geometry : { type : "Point", coordinates : [1.4528388, 43.5956005] }, $maxDistance : 500
![Page 25: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/25.jpg)
Query : “in” the polygondb.points.find(!! { "loc" :{!!! ! ! $geoIntersects : {!! ! ! ! $geometry : !! ! ! ! {type : "Point", !! ! ! ! coordinates:[1.443934, 43.604446]}!! ! ! }!! ! }!! });
![Page 26: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/26.jpg)
Query : all points in a Polygondb.points.find(!{ "loc" :{ $geoWithin : !! ! {$geometry :!! ! ! { "type" : "Polygon",!! ! ! ! "coordinates" : [[!! ! ! ! [1.4528388, 43.5956005],[1.3996881, 43.5976828],!! ! ! ! [1.4001065, 43.6364262],[1.4518624, 43.6324835],!! ! ! ! [1.4528388, 43.5956005]]] !! ! ! }}}});
![Page 27: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/27.jpg)
Questions?
![Page 28: Some cool features of MongoDB](https://reader033.fdocuments.us/reader033/viewer/2022052823/55515a0ab4c905a8768b4b89/html5/thumbnails/28.jpg)
#ConferenceHashtag
Thank You