com presentations: Updates from round two going through the tutorial with Jeremy: slides/mongodb/aggr-aggr-framework.xml slides/mongodb/aggr-op-group-collect-example.xml slides/mongodb/aggr-op-group-compound-example.xml slides/mongodb/aggr-op-group-sum-count-example.xml slides/mongodb/aggr-op-limit-example.xml slides/mongodb/aggr-op-match-example.xml slides/mongodb/aggr-op-match-with-query-example.xml slides/mongodb/aggr-op-project-create-sub-exa
[email protected] (Derick Rethans)
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: db0e9a68d61b9276321d389835edc40e95503f29 Author: Derick Rethans <[email protected]> Sun, 17 May 2015 11:06:51 -0500 Parents: be09e0a5a7d867700051b0e52cab6be7dd756443 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=db0e9a68d61b9276321d389835edc40e95503f29 Log: Updates from round two going through the tutorial with Jeremy Changed paths: M slides/mongodb/aggr-aggr-framework.xml M slides/mongodb/aggr-op-group-collect-example.xml M slides/mongodb/aggr-op-group-compound-example.xml M slides/mongodb/aggr-op-group-sum-count-example.xml M slides/mongodb/aggr-op-limit-example.xml M slides/mongodb/aggr-op-match-example.xml M slides/mongodb/aggr-op-match-with-query-example.xml M slides/mongodb/aggr-op-project-create-sub-example.xml M slides/mongodb/aggr-op-project-incl-excl-example.xml M slides/mongodb/aggr-op-project-rename-compute-example.xml M slides/mongodb/aggr-op-skip-example.xml M slides/mongodb/aggr-op-sort-example.xml M slides/mongodb/aggr-op-unwind-example.xml M slides/mongodb/aggr-pipeline.xml M slides/mongodb/aggr-pipelines-ops.xml M slides/mongodb/idx-cities-by-name-and-pop.xml M slides/mongodb/idx-cities-by-pop-and-dem.xml M slides/mongodb/idx-cities-by-pop-and-dem5.xml M slides/mongodb/idx-create-php.xml M slides/mongodb/idx-recap2.xml M slides/mongodb/idx-recap3.xml M slides/mongodb/idx-which-one-is-picked.xml
diff_db0e9a68d61b9276321d389835edc40e95503f29.txt
(text/plain, 11.9 KB)
diff --git a/slides/mongodb/aggr-aggr-framework.xml b/slides/mongodb/aggr-aggr-framework.xml
index 241143b..70e54e0 100644
--- a/slides/mongodb/aggr-aggr-framework.xml
+++ b/slides/mongodb/aggr-aggr-framework.xml
@@ -2,7 +2,7 @@
<title>Aggregation Framework</title>
<list>
- <bullet>Declared in JSON, executes in C++</bullet>
+ <bullet>Declared in BSON, executes in C++</bullet>
<bullet>Flexible, functional, and *simple*
<list>
<bullet>Operation pipeline</bullet>
diff --git a/slides/mongodb/aggr-op-group-collect-example.xml b/slides/mongodb/aggr-op-group-collect-example.xml
index f2a2f7c..53eab5d 100644
--- a/slides/mongodb/aggr-op-group-collect-example.xml
+++ b/slides/mongodb/aggr-op-group-collect-example.xml
@@ -35,7 +35,7 @@
beers: { *'$addToSet': '$beer_name'* }
} }
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"_id" : "Paulaner Gruppe",
diff --git a/slides/mongodb/aggr-op-group-compound-example.xml b/slides/mongodb/aggr-op-group-compound-example.xml
index 5a2f65a..d0e037b 100644
--- a/slides/mongodb/aggr-op-group-compound-example.xml
+++ b/slides/mongodb/aggr-op-group-compound-example.xml
@@ -45,6 +45,7 @@
beers: { *'$addToSet': '$beer_name'* }
} }
</example>
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
diff --git a/slides/mongodb/aggr-op-group-sum-count-example.xml b/slides/mongodb/aggr-op-group-sum-count-example.xml
index 5f5c53e..0b2cc03 100644
--- a/slides/mongodb/aggr-op-group-sum-count-example.xml
+++ b/slides/mongodb/aggr-op-group-sum-count-example.xml
@@ -37,7 +37,7 @@
count: { *'$sum': 1* }
} }
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"_id" : "Brouwerij Huyghe",
diff --git a/slides/mongodb/aggr-op-limit-example.xml b/slides/mongodb/aggr-op-limit-example.xml
index 2fc9b6e..9be0080 100644
--- a/slides/mongodb/aggr-op-limit-example.xml
+++ b/slides/mongodb/aggr-op-limit-example.xml
@@ -21,6 +21,7 @@
<example inline="3">
*{ $limit : 5 }*
</example>
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{ "beer_name" : "Old Engine Oil" }
diff --git a/slides/mongodb/aggr-op-match-example.xml b/slides/mongodb/aggr-op-match-example.xml
index 2a6c3e1..b2b0fad 100644
--- a/slides/mongodb/aggr-op-match-example.xml
+++ b/slides/mongodb/aggr-op-match-example.xml
@@ -17,7 +17,7 @@
}
{
"beer_name" : "Byron Lager",
- *"brewery_name" : "Camden Town Brewery",
+ "brewery_name" : "Camden Town Brewery",
"beer_type" : "Euro Lager"
}
</example>
@@ -33,7 +33,7 @@
* }*
}
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"beer_name" : "Old Rascal",
diff --git a/slides/mongodb/aggr-op-match-with-query-example.xml b/slides/mongodb/aggr-op-match-with-query-example.xml
index cf6f6a3..025fe03 100644
--- a/slides/mongodb/aggr-op-match-with-query-example.xml
+++ b/slides/mongodb/aggr-op-match-with-query-example.xml
@@ -27,11 +27,13 @@
</td>
<td>
<example inline="3">
-{ $match: {
-* "beer_abv": { $gte: 6 }*
-} }
+{
+ $match: {
+* "beer_abv": { $gte: 6 }*
+ }
+}
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"beer_name" : "Premium Organic Cider",
diff --git a/slides/mongodb/aggr-op-project-create-sub-example.xml b/slides/mongodb/aggr-op-project-create-sub-example.xml
index 57eed76..64efac3 100644
--- a/slides/mongodb/aggr-op-project-create-sub-example.xml
+++ b/slides/mongodb/aggr-op-project-create-sub-example.xml
@@ -28,7 +28,7 @@
* }*
} }
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"name": "Crazy Goat",
diff --git a/slides/mongodb/aggr-op-project-incl-excl-example.xml b/slides/mongodb/aggr-op-project-incl-excl-example.xml
index 7138c7b..08a8861 100644
--- a/slides/mongodb/aggr-op-project-incl-excl-example.xml
+++ b/slides/mongodb/aggr-op-project-incl-excl-example.xml
@@ -30,7 +30,7 @@
*}*
}
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"beer_name" : "Honey's Midford Cider",
diff --git a/slides/mongodb/aggr-op-project-rename-compute-example.xml b/slides/mongodb/aggr-op-project-rename-compute-example.xml
index 2473429..4c25448 100644
--- a/slides/mongodb/aggr-op-project-rename-compute-example.xml
+++ b/slides/mongodb/aggr-op-project-rename-compute-example.xml
@@ -30,7 +30,7 @@
'country': *'$brewery_country'*
} }
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{
"_id" : ObjectId("5400a24f44670a01098b4657"),
diff --git a/slides/mongodb/aggr-op-skip-example.xml b/slides/mongodb/aggr-op-skip-example.xml
index ec882e0..9105455 100644
--- a/slides/mongodb/aggr-op-skip-example.xml
+++ b/slides/mongodb/aggr-op-skip-example.xml
@@ -21,6 +21,7 @@
<example inline="3">
*{ $skip : 2 }*
</example>
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{ "beer_name" : "Du Monde Blanc" }
diff --git a/slides/mongodb/aggr-op-sort-example.xml b/slides/mongodb/aggr-op-sort-example.xml
index 8fc9f13..826edf4 100644
--- a/slides/mongodb/aggr-op-sort-example.xml
+++ b/slides/mongodb/aggr-op-sort-example.xml
@@ -23,6 +23,7 @@
* beer_name: 1*
} }
</example>
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{ "beer_name" : "Beer Geek Breakfast" }
diff --git a/slides/mongodb/aggr-op-unwind-example.xml b/slides/mongodb/aggr-op-unwind-example.xml
index 33a6a3a..3173ccd 100644
--- a/slides/mongodb/aggr-op-unwind-example.xml
+++ b/slides/mongodb/aggr-op-unwind-example.xml
@@ -16,10 +16,6 @@
"Final Frontier DIPA",
"Imperial Stout",
"Svaneke Choko Stout",
- "Henrik Kaffesort",
- "Hibernate",
- "Pop Loves",
- "Beer Geek Breakfast"
]
}
</example>
@@ -33,7 +29,7 @@
* $unwind: '$beers'*
}
</example>
-
+<blurb align="center" class="large">↓</blurb>
<example inline="3">
{ "_id" : "Denmark", "beers" : "Mochaccino Messiah" }
{ "_id" : "Denmark", "beers" : "Texas Ranger" }
@@ -43,10 +39,6 @@
{ "_id" : "Denmark", "beers" : "Final Frontier DIPA" }
{ "_id" : "Denmark", "beers" : "Imperial Stout" }
{ "_id" : "Denmark", "beers" : "Svaneke Choko Stout" }
-{ "_id" : "Denmark", "beers" : "Henrik Kaffesort" }
-{ "_id" : "Denmark", "beers" : "Hibernate" }
-{ "_id" : "Denmark", "beers" : "Pop Loves" }
-{ "_id" : "Denmark", "beers" : "Beer Geek Breakfast" }
</example>
</td></tr></table>
</slide>
diff --git a/slides/mongodb/aggr-pipeline.xml b/slides/mongodb/aggr-pipeline.xml
index 206fcb0..0addac2 100644
--- a/slides/mongodb/aggr-pipeline.xml
+++ b/slides/mongodb/aggr-pipeline.xml
@@ -5,7 +5,7 @@
<bullet>Process a stream of documents
<list>
<bullet>Original input is a collection</bullet>
- <bullet>Final output is a result document</bullet>
+ <bullet>Final output is a cursor (or inline result)</bullet>
</list>
</bullet>
<bullet>Series of operators
diff --git a/slides/mongodb/aggr-pipelines-ops.xml b/slides/mongodb/aggr-pipelines-ops.xml
index bf89392..d9178a7 100644
--- a/slides/mongodb/aggr-pipelines-ops.xml
+++ b/slides/mongodb/aggr-pipelines-ops.xml
@@ -3,11 +3,12 @@
<list>
<bullet>%$match%</bullet>
+ <bullet>%$geoNear%</bullet>
<bullet>%$project%</bullet>
<bullet>%$group%</bullet>
<bullet>%$unwind%</bullet>
</list>
-<break lines="2"/>
+<break/>
<list>
<bullet>%$sort%</bullet>
<bullet>%$limit%</bullet>
diff --git a/slides/mongodb/idx-cities-by-name-and-pop.xml b/slides/mongodb/idx-cities-by-name-and-pop.xml
index 2a116fb..4032c50 100644
--- a/slides/mongodb/idx-cities-by-name-and-pop.xml
+++ b/slides/mongodb/idx-cities-by-name-and-pop.xml
@@ -16,7 +16,7 @@
<tr><td>...</td><td>...</td><td>...</td></tr>
</table>
<example>
-db.cities.ensureIndex( { country_code: 1, population: 1 } );
+db.cities.createIndex( { country_code: 1, population: 1 } );
</example>
</slide>
diff --git a/slides/mongodb/idx-cities-by-pop-and-dem.xml b/slides/mongodb/idx-cities-by-pop-and-dem.xml
index 3b4178c..d7e287d 100644
--- a/slides/mongodb/idx-cities-by-pop-and-dem.xml
+++ b/slides/mongodb/idx-cities-by-pop-and-dem.xml
@@ -12,5 +12,5 @@
<tr><td>MX</td><td>Mexico City</td><td>12294193</td><td>2240</td></tr>
<tr><td>...</td><td>...</td><td>...</td><td>...</td></tr>
</table>
-<example>db.cities.ensureIndex( { population: 1, elevation: 1 } );</example>
+<example>db.cities.createIndex( { population: 1, elevation: 1 } );</example>
</slide>
diff --git a/slides/mongodb/idx-cities-by-pop-and-dem5.xml b/slides/mongodb/idx-cities-by-pop-and-dem5.xml
index a277bcd..8ac84aa 100644
--- a/slides/mongodb/idx-cities-by-pop-and-dem5.xml
+++ b/slides/mongodb/idx-cities-by-pop-and-dem5.xml
@@ -2,7 +2,7 @@
<title>Sorting by descending elevation - take 2</title>
<example inline="1">
-db.cities.ensureIndex( { elevation: -1 } );
+db.cities.createIndex( { elevation: -1 } );
db.cities.find( { population: { $gte: 2000000 }, elevation: { $gte : 1654 } } )
.sort( { elevation: -1 } ).explain();
</example>
diff --git a/slides/mongodb/idx-create-php.xml b/slides/mongodb/idx-create-php.xml
index da02b0f..0a57739 100644
--- a/slides/mongodb/idx-create-php.xml
+++ b/slides/mongodb/idx-create-php.xml
@@ -1,7 +1,7 @@
<slide>
<title>Creating Indexes</title>
-<blurb>The %_id% field is always indexed. Additional indexes can be created with %ensureIndex%:</blurb>
+<blurb>The %_id% field is always indexed. Additional indexes can be created with %createIndex%:</blurb>
<example><![CDATA[
<?php
@@ -9,13 +9,13 @@ $m = new MongoClient;
$c = $m->tutorial->beer;
// Create an index on the beer name attribute
-$c->ensureIndex( [ 'beer_name' => 1 ] );
+$c->createIndex( [ 'beer_name' => 1 ] );
// Create a compound index on beer name and brewery name
-$c->ensureIndex( [ 'beer_name' => 1, 'brewery_name' => 1 ] );
+$c->createIndex( [ 'beer_name' => 1, 'brewery_name' => 1 ] );
// Create a unique index on the name field of the venue attribute
-$c->ensureIndex( [ 'venue.name' => 1 ] );
+$c->createIndex( [ 'venue.name' => 1 ] );
?>
]]>
</example>
diff --git a/slides/mongodb/idx-recap2.xml b/slides/mongodb/idx-recap2.xml
index 09ecfce..16604d5 100644
--- a/slides/mongodb/idx-recap2.xml
+++ b/slides/mongodb/idx-recap2.xml
@@ -3,7 +3,7 @@
<blurb>Indexes are used from left to right.</blurb>
-<example inline="1">$c->ensureIndex( [ 'country_code' => 1, 'timezone' => 1, 'asciiname' => 1 ] )</example>
+<example inline="1">$c->createIndex( [ 'country_code' => 1, 'timezone' => 1, 'asciiname' => 1 ] )</example>
<break/>
<div effect="fade-in">
<example inline="1">|00aa00|✔| %$c->find(['country_code' => 'GB']);%</example>
diff --git a/slides/mongodb/idx-recap3.xml b/slides/mongodb/idx-recap3.xml
index 2b5ef7e..b811d5e 100644
--- a/slides/mongodb/idx-recap3.xml
+++ b/slides/mongodb/idx-recap3.xml
@@ -2,10 +2,9 @@
<title>When can indexes not be used?</title>
<list>
- <bullet>Many sorts of negations (%$ne%, %$not%, %$nin%).</bullet>
- <bullet>Tricky aritmethic (%$mod%).</bullet>
+ <bullet>Many types of negations (%$ne%, %$not%, %$nin%).</bullet>
+ <bullet>Tricky arithmetic (%$mod%).</bullet>
<bullet>Most regular expressions (%/ondo/%), unless anchored to the start of the string (%/^Lon/%).</bullet>
<bullet>JavaScript expressions in %$where% clauses, such as %where elevation > population%. In that case, try to pre-compute.</bullet>
- <bullet>map/reduce</bullet>
</list>
</slide>
diff --git a/slides/mongodb/idx-which-one-is-picked.xml b/slides/mongodb/idx-which-one-is-picked.xml
index 8e1bafb..767077a 100644
--- a/slides/mongodb/idx-which-one-is-picked.xml
+++ b/slides/mongodb/idx-which-one-is-picked.xml
@@ -2,7 +2,7 @@
<title>How does MongoDB pick an index?</title>
<list>
- <bullet>MongoDB does not keep statistics</bullet>
+ <bullet>MongoDB does not keep cardinality statistics</bullet>
<bullet>MongoDB tries all the possible indexes</bullet>
<bullet>When it has found the fastest one, it remembers it</bullet>
<bullet>MongoDB will re-try plans once in a while</bullet>