com presentations: Added slides for MongoDB UK: mongo-index-mongouk12.xml osm-mongouk12.xml slides/map/leaflet.xml slides/map/osm-data.xml
slides/map/title.xml slides/mongodb/10gen.png slides/mongodb/cities15000.png slides/mongodb/idx-cities-by-country-and-type.xml
slides/mongodb/idx-cities-by-name-and-pop.xml slides/mongodb/idx-cities-by-name-and-pop2.xml slides/mongodb/idx-cities-by-name-and-pop3.xml
slides/mongodb/idx-cities-by-name.xml slides

From: Date: Mon, 18 Jun 2012 21:06:33 +0000
Subject: com presentations: Added slides for MongoDB UK: mongo-index-mongouk12.xml osm-mongouk12.xml slides/map/leaflet.xml slides/map/osm-data.xml
slides/map/title.xml slides/mongodb/10gen.png slides/mongodb/cities15000.png slides/mongodb/idx-cities-by-country-and-type.xml
slides/mongodb/idx-cities-by-name-and-pop.xml slides/mongodb/idx-cities-by-name-and-pop2.xml slides/mongodb/idx-cities-by-name-and-pop3.xml
slides/mongodb/idx-cities-by-name.xml slides
Groups: php.pres 
Request: Send a blank email to pres+get-1818@lists.php.net to get a copy of this message
Commit: 12ebada0ab4502234e476b6b5021e68b3e3399f8 Author: Derick Rethans <github@derickrethans.nl> Mon, 18 Jun 2012 22:06:33 +0100 Parents: e15395e23ae3cac4aca5b5a5bc1df7afb6a086cd Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=12ebada0ab4502234e476b6b5021e68b3e3399f8 Log: Added slides for MongoDB UK Changed paths: A mongo-index-mongouk12.xml A osm-mongouk12.xml M slides/map/leaflet.xml M slides/map/osm-data.xml M slides/map/title.xml M slides/mongodb/10gen.png A slides/mongodb/cities15000.png A slides/mongodb/idx-cities-by-country-and-type.xml A slides/mongodb/idx-cities-by-name-and-pop.xml A slides/mongodb/idx-cities-by-name-and-pop2.xml A slides/mongodb/idx-cities-by-name-and-pop3.xml A slides/mongodb/idx-cities-by-name.xml A slides/mongodb/idx-cities-by-pop-and-dem.xml A slides/mongodb/idx-cities-by-pop-and-dem2.xml A slides/mongodb/idx-cities-by-pop-and-dem3.xml A slides/mongodb/idx-cities-by-pop-and-dem4.xml A slides/mongodb/idx-cities-by-pop-and-dem5.xml A slides/mongodb/idx-cities-by-pop-and-dem6.xml A slides/mongodb/idx-covered.xml A slides/mongodb/idx-create.xml A slides/mongodb/idx-geo.xml A slides/mongodb/idx-geo2.xml A slides/mongodb/idx-geo3.xml A slides/mongodb/idx-geo4.xml A slides/mongodb/idx-how-do-you-find-a-city.xml A slides/mongodb/idx-how-do-you-find-a-large-city-on-a-mountain.xml A slides/mongodb/idx-how-do-you-find-a-large-city.xml A slides/mongodb/idx-map.xml A slides/mongodb/idx-map2.xml A slides/mongodb/idx-multi-key.xml A slides/mongodb/idx-recap1.xml A slides/mongodb/idx-recap2.xml A slides/mongodb/idx-recap3.xml A slides/mongodb/idx-sparse.xml A slides/mongodb/idx-sparse2.xml A slides/mongodb/idx-startup-quotes.xml A slides/mongodb/idx-startup-quotes2.xml A slides/mongodb/idx-startup-quotes3.xml A slides/mongodb/idx-stored.xml A slides/mongodb/idx-unique.xml A slides/mongodb/idx-whats-in-store.xml A slides/mongodb/idx-which-one-is-picked.xml M slides/mongodb/me.xml A slides/mongodb/mongo-compound-index-null.png A slides/mongodb/mongo-compound-index-sparse.png A slides/mongodb/mongo-compound-index-sparse2.png A slides/mongodb/mongo-compound-index.png M slides/mongodb/title.xml M templates/default/slide.ezt

diff --git a/mongo-index-mongouk12.xml b/mongo-index-mongouk12.xml new file mode 100644 index 0000000..73edb8d --- /dev/null +++ b/mongo-index-mongouk12.xml @@ -0,0 +1,67 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen-strict.css"> +<topic>mongoDB</topic> +<title>Indexing and Query Optimisation</title> +<event>MongoDB UK</event> +<location>London, UK</location> +<date>Jun 20th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@10gen.com</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>e-mail me!</joindin> + +<!-- +sleep 4; for i in `seq 0 7`; do ^Crefox http://pres/show2.php/mongo-index-mongouk12/$i; sleep 3; import -window 0x2c00077 /tmp/win$i.jpg; done +--> + +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/idx-whats-in-store.xml</slide> +<slide>slides/mongodb/idx-startup-quotes.xml</slide> +<slide>slides/mongodb/idx-startup-quotes2.xml</slide> +<slide>slides/mongodb/idx-startup-quotes3.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/mongodb/idx-map.xml</slide> +<slide>slides/mongodb/idx-how-do-you-find-a-city.xml</slide> +<slide>slides/mongodb/idx-create.xml</slide> + +<slide>slides/mongodb/idx-cities-by-name.xml</slide> +<slide>slides/mongodb/idx-how-do-you-find-a-large-city.xml</slide> +<slide>slides/mongodb/idx-cities-by-name-and-pop.xml</slide> +<slide>slides/mongodb/idx-cities-by-name-and-pop2.xml</slide> +<slide>slides/mongodb/idx-cities-by-name-and-pop3.xml</slide> +<slide>slides/mongodb/idx-how-do-you-find-a-large-city-on-a-mountain.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem2.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem3.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem4.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem6.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem5.xml</slide> + +<slide>slides/mongodb/idx-unique.xml</slide> +<slide>slides/mongodb/idx-sparse.xml</slide> +<slide>slides/mongodb/idx-sparse2.xml</slide> +<slide>slides/mongodb/idx-covered.xml</slide> +<slide>slides/mongodb/idx-multi-key.xml</slide> +<slide>slides/mongodb/idx-which-one-is-picked.xml</slide> + +<slide>slides/mongodb/idx-map2.xml</slide> +<slide>slides/mongodb/idx-geo.xml</slide> +<slide>slides/mongodb/idx-geo2.xml</slide> +<slide>slides/mongodb/idx-geo3.xml</slide> +<slide>slides/mongodb/idx-geo4.xml</slide> + +unique +sparse +indexonly +multikey +2d + +<slide>slides/mongodb/idx-recap1.xml</slide> +<slide>slides/mongodb/idx-recap2.xml</slide> +<slide>slides/mongodb/idx-recap3.xml</slide> + +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/osm-mongouk12.xml b/osm-mongouk12.xml new file mode 100644 index 0000000..8c41aab --- /dev/null +++ b/osm-mongouk12.xml @@ -0,0 +1,62 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen-strict.css"> +<topic>Maps</topic> +<title>Geolocation, Maps and MongoDB</title> +<event>MongoDB UK</event> +<location>London, UK</location> +<date>June 20th, 2012</date> +<speaker>Derick Rethans</speaker> +<email>derick@derickrethans.nl</email> +<twitter>derickr</twitter> +<joindin>e-mail me!</joindin> +<slide>slides/map/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<!-- +In this talk I will be explaining the strong points of OpenStreetMap and why +using GoogleMaps for your websites is generally a bad idea. Contrary to popular +belief, GoogleMaps isn't as amazing as it looks and they are a lot more evil +than they look. OpenStreetMap's data is also easily accessible for use in PHP +applications and the generated tiles can easily be embedded into a Web 2.0 +application. Its open nature is a welcome and powerful geo database that can be +added to and used in whatever way imaginary. +--> + +<!-- +What is X? +--> +<slide>slides/map/osm-what.xml</slide> +<slide>slides/map/what-is-osm.xml</slide> +<slide>slides/map/leaflet.xml</slide> + +<slide>slides/map/openlayers-location.xml</slide> +<slide>slides/map/openlayers-location-services.xml</slide> +<slide>slides/map/reverse.xml</slide> +<slide>slides/map/reverse-services.xml</slide> + +<slide>slides/map/osm-data.xml</slide> + +<slide>slides/map/osm-tags-edit.xml</slide> + + +<slide>slides/map/osm-mapping-party1.xml</slide> +<slide>slides/map/osm-editors.xml</slide> +<slide>slides/map/osm-data-uses.xml</slide> + +<slide>slides/map/osm-parse-into-db.xml</slide> +<slide>slides/map/osm-xapi.xml</slide> +<slide>slides/mongodb/osm-to-mongo-data.xml</slide> +<slide>slides/mongodb/osm-to-mongo-data2.xml</slide> +<slide>slides/mongodb/osm-to-mongo-data3.xml</slide> +<slide>slides/mongodb/osm-to-mongo-data4.xml</slide> +<slide>slides/map/finding-food-import-mongo.xml</slide> +<slide>slides/map/finding-food-import-mongo2.xml</slide> + +<slide>slides/mongodb/indexes-geo.xml</slide> +<slide>slides/mongodb/indexes-geo2.xml</slide> + +<slide>slides/map/finding-food-take2.xml</slide> + +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/slides/map/leaflet.xml b/slides/map/leaflet.xml index f7607ea..6860180 100644 --- a/slides/map/leaflet.xml +++ b/slides/map/leaflet.xml @@ -9,24 +9,24 @@ <!DOCTYPE html> <html> <head> - <title>Leaflet Quick Start Guide Example</title> - <meta charset="utf-8" /> - - <link rel="stylesheet" href="leaflet/leaflet.css" /> - <!--[if lte IE 8]><link rel="stylesheet" href="leaflet/leaflet.ie.css" /><![endif]--> - <script src="leaflet/leaflet.js"></script> + <title>Leaflet Quick Start Guide Example</title> + <meta charset="utf-8" /> + + <link rel="stylesheet" href="leaflet/leaflet.css" /> + <!--[if lte IE 8]><link rel="stylesheet" href="leaflet/leaflet.ie.css" /><![endif]--> + <script src="leaflet/leaflet.js"></script> </head> <body> - <div id="map" style="width: 1004px; height: 590px"></div> - <script type="text/javascript"> - var map = new L.Map('map'); - - var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', - osmAttrib = 'Map data &copy; 2011 OpenStreetMap contributors', - osm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}); - - map.setView(new L.LatLng(51.5179, -0.12), 13).addLayer(osm); - </script> + <div id="map" style="width: 1004px; height: 590px"></div> + <script type="text/javascript"> + var map = new L.Map('map'); + + var osmUrl = 'http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', + osmAttrib = 'Map data &copy; 2011 OpenStreetMap contributors', + osm = new L.TileLayer(osmUrl, {maxZoom: 18, attribution: osmAttrib}); + + map.setView(new L.LatLng(51.5179, -0.12), 13).addLayer(osm); + </script> </body> </html>]]></example> </div> diff --git a/slides/map/osm-data.xml b/slides/map/osm-data.xml index 54772dc..5c1e6aa 100644 --- a/slides/map/osm-data.xml +++ b/slides/map/osm-data.xml @@ -5,8 +5,8 @@ <bullet>Nodes (Lat/Lon point)<br/> <example><![CDATA[<node id='459517295' lat='50.0100766' lon='8.3162402' user='WoGo' timestamp='2009-08-09T11:45:33Z' uid='152395' version='1' changeset='2083951'>]]></example> </bullet> - <bullet>Ways (Ordered interconnection of nodes)</bullet> - <bullet>Areas (Closed ways) + <bullet>Ways (Ordered interconnection of nodes, ie: roads)</bullet> + <bullet>Areas (Closed ways, ie: buildings, squares and landuse) <example><![CDATA[<way id='76174399' user='Derick Rethans' uid='37137' timestamp='2010-09-06T08:30:14Z' version='1' changeset='5695697'> <nd ref='898861293'/> <nd ref='898861305'/> diff --git a/slides/map/title.xml b/slides/map/title.xml index 6ab39e8..e806577 100644 --- a/slides/map/title.xml +++ b/slides/map/title.xml @@ -1,6 +1,4 @@ <slide template="white" type="title" background="london-map-old.jpg"> -<title>Welcome!</title> - <blurb class="event-title">:-:title:-:</blurb> <blurb class="event-date">:-:event:-: - :-:location:-: - :-:date:-:</blurb> <blurb class="event-presenter">Derick Rethans - :-:email:-: - twitter: @:-:twitter:-:</blurb> diff --git a/slides/mongodb/10gen.png b/slides/mongodb/10gen.png index bfd4a43..595b011 100644 Binary files a/slides/mongodb/10gen.png and b/slides/mongodb/10gen.png differ diff --git a/slides/mongodb/cities15000.png b/slides/mongodb/cities15000.png new file mode 100644 index 0000000..bcc3a89 Binary files /dev/null and b/slides/mongodb/cities15000.png differ diff --git a/slides/mongodb/idx-cities-by-country-and-type.xml b/slides/mongodb/idx-cities-by-country-and-type.xml new file mode 100644 index 0000000..eb323cb --- /dev/null +++ b/slides/mongodb/idx-cities-by-country-and-type.xml @@ -0,0 +1,18 @@ +<slide> +<title>Let's imagine another compound index</title> + +<table> +<tr><th>_Country_</th><th>_Type_</th><th>Name</th></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>GB</td><td>PPLA</td><td>Edinburgh</td></tr> +<tr><td>GB</td><td>PPL</td><td>Egham</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>GB</td><td>PPLC</td><td>London</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>NL</td><td>PPLC</td><td>Amsterdam</td></tr> +<tr><td>NL</td><td>PPLA</td><td>Arnhem</td></tr> +<tr><td>NL</td><td>PPLA</td><td>Assen</td></tr> +<tr><td>NL</td><td>PPLG</td><td>Den Haag</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +</table> +</slide> diff --git a/slides/mongodb/idx-cities-by-name-and-pop.xml b/slides/mongodb/idx-cities-by-name-and-pop.xml new file mode 100644 index 0000000..2a116fb --- /dev/null +++ b/slides/mongodb/idx-cities-by-name-and-pop.xml @@ -0,0 +1,22 @@ +<slide> +<title>Let's imagine a compound index</title> + +<table> +<tr><th>_Country Code_</th><th>_Population_</th><th>Name</th></tr> +<tr><td>AD</td><td>15853</td><td>les Escaldes</td></tr> +<tr><td>AD</td><td>20430</td><td>Andorra la Vella</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>GB</td><td>435791</td><td>Edinburgh</td></tr> +<tr><td>GB</td><td>447047</td><td>Sheffield</td></tr> +<tr><td>GB</td><td>455123</td><td>Leeds</td></tr> +<tr><td>GB</td><td>468945</td><td>Liverpool</td></tr> +<tr><td>GB</td><td>610268</td><td>Glasgow</td></tr> +<tr><td>GB</td><td>984333</td><td>Birmingham</td></tr> +<tr><td>GB</td><td>7556900</td><td>London</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +</table> +<example> +db.cities.ensureIndex( { country_code: 1, population: 1 } ); +</example> + +</slide> diff --git a/slides/mongodb/idx-cities-by-name-and-pop2.xml b/slides/mongodb/idx-cities-by-name-and-pop2.xml new file mode 100644 index 0000000..51f4ade --- /dev/null +++ b/slides/mongodb/idx-cities-by-name-and-pop2.xml @@ -0,0 +1,31 @@ +<slide> +<title>Let's look at the query plan</title> + +<example inline="1"> +db.cities.find( { country_code: 'GB', population: { $gte: 500000 } } ).*explain()*; +</example> +<example inline="1"> +{ + "cursor" : "*BtreeCursor country_code_1_population_1*", + |00aa00|"nscanned" : 4,| + |00aa00|"nscannedObjects" : 4,| + |00aa00|"n" : 4,| + "millis" : 0, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + "indexOnly" : false, + "indexBounds" : { + "country_code" : [ [ "GB", "GB" ] ], + "population" : [ [ 500000, 1.7976931348623157e+308 ] ] + } +} +</example> +<example> +{ "name" : "Glasgow", "country_code" : "GB", "population" : 610268 } +{ "name" : "Birmingham", "country_code" : "GB", "population" : 984333 } +{ "name" : "City of London", "country_code" : "GB", "population" : 7556900 } +{ "name" : "London", "country_code" : "GB", "population" : 7556900 } +</example> + +</slide> diff --git a/slides/mongodb/idx-cities-by-name-and-pop3.xml b/slides/mongodb/idx-cities-by-name-and-pop3.xml new file mode 100644 index 0000000..6c9404e --- /dev/null +++ b/slides/mongodb/idx-cities-by-name-and-pop3.xml @@ -0,0 +1,32 @@ +<slide> +<title>Let's look at the query plan when we try to sort</title> + +<example inline="1"> +db.cities.find( { country_code: 'GB', population: { $gte: 500000 } } ) + .sort( { population: -1 }).explain(); +</example> +<example inline="1"> +{ + "cursor" : "BtreeCursor country_code_1_population_1 ~*reverse*~", + "nscanned" : 4, + "nscannedObjects" : 4, + "n" : 4, + "millis" : 0, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + "indexOnly" : false, + "indexBounds" : { + "country_code" : [ [ "GB", "GB" ] ], + "population" : [ [ ~*1.7976931348623157e+308, 500000*~ ] ] + } +} +</example> +<example> +{ "name" : "London", "country_code" : "GB", "population" : 7556900 } +{ "name" : "City of London", "country_code" : "GB", "population" : 7556900 } +{ "name" : "Birmingham", "country_code" : "GB", "population" : 984333 } +{ "name" : "Glasgow", "country_code" : "GB", "population" : 610268 } +</example> + +</slide> diff --git a/slides/mongodb/idx-cities-by-name.xml b/slides/mongodb/idx-cities-by-name.xml new file mode 100644 index 0000000..d8e68c2 --- /dev/null +++ b/slides/mongodb/idx-cities-by-name.xml @@ -0,0 +1,19 @@ +<slide> +<title>Let's imagine a simple index</title> + +<table> +<tr><th>_City_</th><th>Longitude</th><th>Latitude</th></tr> +<tr><td>Aabenraa</td><td>55.04434</td><td>9.41741</td></tr> +<tr><td>Aachen</td><td>50.77664</td><td>6.08342</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>London</td><td>51.50853</td><td>-0.12574</td></tr> +<tr><td>Londonderry County Borough</td><td>54.99721</td><td>-7.30917</td></tr> +<tr><td>Londrina</td><td>-23.31028</td><td>-51.16278</td></tr> +<tr><td>...</td><td>...</td><td>...</td></tr> +<tr><td>Zwijndrecht</td><td>51.8175</td><td>4.63333</td></tr> +<tr><td>Zwolle</td><td>52.5125</td><td>6.09444</td></tr> +<tr><td>Żyrardów</td><td>52.0488</td><td>20.44599</td></tr> +<tr><td>Zyryanovsk</td><td>49.72654</td><td>84.27318</td></tr> +<tr><td>Żywiec</td><td>49.68529</td><td>19.19243</td></tr> +</table> +</slide> diff --git a/slides/mongodb/idx-cities-by-pop-and-dem.xml b/slides/mongodb/idx-cities-by-pop-and-dem.xml new file mode 100644 index 0000000..c8b144a --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem.xml @@ -0,0 +1,16 @@ +<slide> +<title>Let's imagine another compound index</title> + +<table> +<tr><th>Country</th><th>Name</th><th>_Population_</th><th>_DEM_</th></tr> +<tr><td>AD</td><td>les Escaldes</td><td>15853</td><td>1033</td></tr> +<tr><td>AD</td><td>Andorra la Vella</td><td>20430</td><td>1037</td></tr> +<tr><td>...</td><td>...</td><td>...</td><td>...</td></tr> +<tr><td>ET</td><td>Addis Ababa</td><td>2757729</td><td>2405</td></tr> +<tr><td>ET</td><td>Ādīgrat</td><td>65000</td><td>2451</td></tr> +<tr><td>...</td><td>...</td><td>...</td><td>...</td></tr> +<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, dem: 1 } );</example> +</slide> diff --git a/slides/mongodb/idx-cities-by-pop-and-dem2.xml b/slides/mongodb/idx-cities-by-pop-and-dem2.xml new file mode 100644 index 0000000..eb26e97 --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem2.xml @@ -0,0 +1,33 @@ +<slide> +<title>Let's look at the query plan</title> + +<example inline="1"> +db.cities.find( { population: { $gte: 2000000 }, dem: { $gte: 1654 } } ).explain(); +</example> +<example inline="1"> +{ + "cursor" : "BtreeCursor population_1_dem_1", + |ff8000|"nscanned" : 127,| + |00cc00|"nscannedObjects" : 6,| + |00cc00|"n" : 6,| + "millis" : 3, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + "indexOnly" : false, + "indexBounds" : { + "population" : [ [ 2000000, 1.7976931348623157e+308 ] ], + "dem" : [ [ 1654, 1.7976931348623157e+308 ] ] + } +} +</example> +<example> +{ "name" : "Johannesburg", "population" : 2026469, "dem" : 1767 } +{ "name" : "Nairobi", "population" : 2750547, "dem" : 1684 } +{ "name" : "Addis Ababa", "population" : 2757729, "dem" : 2405 } +{ "name" : "Kabul", "population" : 3043532, "dem" : 1798 } +{ "name" : "Bogotá", "population" : 7102602, "dem" : 2582 } +{ "name" : "Mexico City", "population" : 12294193, "dem" : 2240 } +</example> + +</slide> diff --git a/slides/mongodb/idx-cities-by-pop-and-dem3.xml b/slides/mongodb/idx-cities-by-pop-and-dem3.xml new file mode 100644 index 0000000..d058c21 --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem3.xml @@ -0,0 +1,34 @@ +<slide> +<title>Sorting by descending population</title> + +<example inline="1"> +db.cities.find( { population: { $gte: 2000000 }, dem: { $gte : 1654 } } ) + .sort( { population: -1 } ).explain(); +</example> +<example inline="1"> +{ + "cursor" : "BtreeCursor population_1_dem_1 *reverse*", + "nscanned" : 127, + "nscannedObjects" : 6, + "n" : 6, + "millis" : 1, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + "indexOnly" : false, + "indexBounds" : { + "population" : [ [ 1.7976931348623157e+308, 2000000 ] ], + "dem" : [ [ 1.7976931348623157e+308, 1654 ] ] + } +} +</example> +<example> +{ "name" : "Mexico City", "population" : 12294193, "dem" : 2240 } +{ "name" : "Bogotá", "population" : 7102602, "dem" : 2582 } +{ "name" : "Kabul", "population" : 3043532, "dem" : 1798 } +{ "name" : "Addis Ababa", "population" : 2757729, "dem" : 2405 } +{ "name" : "Nairobi", "population" : 2750547, "dem" : 1684 } +{ "name" : "Johannesburg", "population" : 2026469, "dem" : 1767 } +</example> + +</slide> diff --git a/slides/mongodb/idx-cities-by-pop-and-dem4.xml b/slides/mongodb/idx-cities-by-pop-and-dem4.xml new file mode 100644 index 0000000..c20f813 --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem4.xml @@ -0,0 +1,19 @@ +<slide> +<title>Sorting by descending elevation</title> + +<example inline="1"> +db.cities.find( { population: { $gte: 2000000 }, dem: { $gte : 1654 } } ) + .sort( { dem: -1 } ).explain(); +</example> +<example inline="1"> +{ + "cursor" : "BtreeCursor population_1_dem_1", + "nscanned" : 127, + "nscannedObjects" : 6, + "n" : 6, + *|f10000|"scanAndOrder" : true,|* + "millis" : 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 new file mode 100644 index 0000000..704ee95 --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem5.xml @@ -0,0 +1,23 @@ +<slide> +<title>Sorting by descending elevation - take 2</title> + +<example inline="1"> +db.cities.ensureIndex( { dem: -1 } ); +db.cities.find( { population: { $gte: 2000000 }, dem: { $gte : 1654 } } ) + .sort( { dem: -1 } ).explain(); +</example> +<example inline="1"> +{ + *|f10000|"cursor" : "BtreeCursor population_1_dem_1",|* + "nscanned" : 127, + "nscannedObjects" : 6, + "n" : 6, + *|f10000|"scanAndOrder" : true,|* + "millis" : 1, +... +</example> +<div effect="fade-in"> +<blurb>MongoDB can only use one index at the same time.</blurb> +</div> + +</slide> diff --git a/slides/mongodb/idx-cities-by-pop-and-dem6.xml b/slides/mongodb/idx-cities-by-pop-and-dem6.xml new file mode 100644 index 0000000..b323b7a --- /dev/null +++ b/slides/mongodb/idx-cities-by-pop-and-dem6.xml @@ -0,0 +1,26 @@ +<slide> +<title>Querying by just the DEM</title> + +<example inline="1"> +db.cities.find( { dem: { $gte : 1654 } } ).explain(); +</example> +<example inline="1"> +{ + *|f10000|"cursor" : "BasicCursor",|* + "nscanned" : 22840, + "nscannedObjects" : 22840, + "n" : 614, + "millis" : 26, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + "indexOnly" : false, + "indexBounds" : { + } +} +</example> +<div effect="fade-in"> +<blurb>MongoDB can not use only the second part of a compound index<br/> (%{ population: 1, dem: 1 }%).</blurb> +</div> + +</slide> diff --git a/slides/mongodb/idx-covered.xml b/slides/mongodb/idx-covered.xml new file mode 100644 index 0000000..31f8eb1 --- /dev/null +++ b/slides/mongodb/idx-covered.xml @@ -0,0 +1,32 @@ +<slide> +<title>Covered Indexes</title> + +<blurb>MongoDB can return data from the *index only*:</blurb> + +<example inline="1"> +db.cities.ensureIndex( { country_code: 1, name: 1 } ); +db.cities.find( + { country_code: 1 }, *{ country_code: 1, name: 1, _id: 0 }* +).explain(); +</example> + +<example inline="1"> +{ + "cursor" : "BtreeCursor country_code_1_name_1", + "nscanned" : 256, + "nscannedObjects" : 256, + "n" : 256, + "millis" : 1, + "nYields" : 0, + "nChunkSkips" : 0, + "isMultiKey" : false, + *"indexOnly" : true,* +... +</example> + +<list> + <bullet>An index needs to be used in the first place</bullet> + <bullet>Make sure to provide a projection</bullet> + <bullet>Remove %_id% explicitly from the projection</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-create.xml b/slides/mongodb/idx-create.xml new file mode 100644 index 0000000..e6c1594 --- /dev/null +++ b/slides/mongodb/idx-create.xml @@ -0,0 +1,16 @@ +<slide> +<title>Creating Indexes</title> + +<blurb>The %_id% field is always indexed. Additional indexes can be created with %ensureIndex%:</blurb> + +<example> +// Create an index on the name attribute +db.cities.ensureIndex( { name: 1 } ); + +// Create a compound index on country code and feature code +db.cities.ensureIndex( { country_code: 1, feature_code: 1 } ); + +// Create a unique index on the area field of timezone: +db.cities.ensureIndex( { 'timezone.area': 1 } ); +</example> +</slide> diff --git a/slides/mongodb/idx-geo.xml b/slides/mongodb/idx-geo.xml new file mode 100644 index 0000000..87f0abd --- /dev/null +++ b/slides/mongodb/idx-geo.xml @@ -0,0 +1,30 @@ +<slide> +<title>Geospatial indexes (2d indexes)</title> + +<blurb>MongoDB supports indexes on two dimensional fields:</blurb> +<example>db.cities.ensureIndex( { location: '2d } )</example> + +<example inline="1"> +db.cities.find( { location: { *$near: [ -0.088, 51.489 ]* } } ); +</example> + +<example inline="1"> +db.cities.find( { location: { $near: [ -0.088, 51.489 ] } } ).explain(); +{ + *"cursor" : "GeoSearchCursor",* + "nscanned" : 100, + "nscannedObjects" : 100, + "n" : 100, +... +</example> + +<list> +<bullet>By default only 100 items, but changable with %limit()%</bullet> +<bullet>You can also add %maxDistance%: +<example inline="1"> +db.cities.find( { location: { $near: [ -0.08, 51.48 ], *$maxDistance: 0.1* } } ); +</example> +</bullet> +</list> + +</slide> diff --git a/slides/mongodb/idx-geo2.xml b/slides/mongodb/idx-geo2.xml new file mode 100644 index 0000000..80b3f3a --- /dev/null +++ b/slides/mongodb/idx-geo2.xml @@ -0,0 +1,32 @@ +<slide> +<title>Geospatial indexes (2d indexes) (geoNear command)</title> + +<example inline="1"> +db.runCommand( { *geoNear: 'cities', near: [ -0.088, 51.489 ], num: 10* } ); +</example> + +<example inline="1"> +{ + "ns" : "demo.cities", + "near" : "0110111010111010111010011111101110111010110010011011", + "results" : [ + { "dis" : 0.024097918997296273, "obj" : { "name" : "City of London", "asciiname" : "City of London", ... }, + { "dis" : 0.02958403792587928, "obj" : { "name" : "Brixton", "asciiname" : "Brixton", ... }, + ], + "stats" : { + "time" : 0, + "btreelocs" : 0, + "nscanned" : 85, + "objectsLoaded" : 26, + "avgDistance" : 0.05905622408516078, + "maxDistance" : 0.09879506691618341 + }, + "ok" : 1 +} +</example> + +<list> + <bullet>Includes distance</bullet> + <bullet>Limited to "one document"</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-geo3.xml b/slides/mongodb/idx-geo3.xml new file mode 100644 index 0000000..98f73b3 --- /dev/null +++ b/slides/mongodb/idx-geo3.xml @@ -0,0 +1,21 @@ +<slide> +<title>Geospatial indexes (spherical)</title> + +<blurb>Since MongoDB 1.8 a spherical model is also supported:</blurb> +<example inline="1"> +db.cities.find( { location: { *$nearSphere*: [ -0.088, 51.489 ] } } ); +</example> + +<example inline="1"> +db.runCommand( { geoNear: 'cities', near: [ -0.088, 51.489 ], *spherical: true* } ); +</example> + +<list> + <bullet>Location needs to be: *latitude, longitude* in a field.</bullet> + <bullet>For 50N and 13E:<list> + <bullet>|00cc00|%[13, -50]%|</bullet> + <bullet>|00cc00|%{ lon : 13, lat : -50 }%|</bullet> + <bullet>|f10000|%{ lat : -50, lon : 13 }%|</bullet> + </list></bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-geo4.xml b/slides/mongodb/idx-geo4.xml new file mode 100644 index 0000000..9418400 --- /dev/null +++ b/slides/mongodb/idx-geo4.xml @@ -0,0 +1,28 @@ +<slide> +<title>Geospatial indexes (spherical)</title> + +<blurb>Find all cities within 150 km from London, in France:</blurb> +<example inline="1"> +db.runCommand( { + geoNear: 'cities', + near: [ -0.088, 51.489 ], + spherical: true, + query: { country_code: 'FR' }, + maxDistance: 150 / *6378* +} )*.results.* + forEach(function(obj) { + print( obj.obj.country_code, '-', obj.obj.name, ': ', *obj.dis *** 6378* ); + } ); +</example> +<example> +FR - Outreau : 146.16198019887855 +FR - Boulogne-sur-Mer : 146.92634969912072 +FR - Calais : 147.59429539150375 +</example> + +<list> + <bullet>Distances are in radians, so convert</bullet> + <bullet>Results are limited to one document (16MB)</bullet> +</list> + +</slide> diff --git a/slides/mongodb/idx-how-do-you-find-a-city.xml b/slides/mongodb/idx-how-do-you-find-a-city.xml new file mode 100644 index 0000000..7cc8335 --- /dev/null +++ b/slides/mongodb/idx-how-do-you-find-a-city.xml @@ -0,0 +1,13 @@ +<slide> +<title>How do you find a city?</title> + +<list> +<bullet>Searching through the whole map is going to take a while...</bullet> +<bullet>You probably want to come up with a smarter solution.</bullet> +</list> +<div effect="fade-in"> +<list> +<bullet>Let's create an index!</bullet> +</list> +</div> +</slide> diff --git a/slides/mongodb/idx-how-do-you-find-a-large-city-on-a-mountain.xml b/slides/mongodb/idx-how-do-you-find-a-large-city-on-a-mountain.xml new file mode 100644 index 0000000..e2351ad --- /dev/null +++ b/slides/mongodb/idx-how-do-you-find-a-large-city-on-a-mountain.xml @@ -0,0 +1,3 @@ +<slide> +<blurb class="quote-page">How do you find a large city on a mountain?</blurb> +</slide> diff --git a/slides/mongodb/idx-how-do-you-find-a-large-city.xml b/slides/mongodb/idx-how-do-you-find-a-large-city.xml new file mode 100644 index 0000000..7f0d26b --- /dev/null +++ b/slides/mongodb/idx-how-do-you-find-a-large-city.xml @@ -0,0 +1,3 @@ +<slide> +<blurb class="quote-page">How do you find a large city in a country?</blurb> +</slide> diff --git a/slides/mongodb/idx-map.xml b/slides/mongodb/idx-map.xml new file mode 100644 index 0000000..406009d --- /dev/null +++ b/slides/mongodb/idx-map.xml @@ -0,0 +1,4 @@ +<slide> +<title>Let's start with a map...</title> +<image filename="cities15000.png"/> +</slide> diff --git a/slides/mongodb/idx-map2.xml b/slides/mongodb/idx-map2.xml new file mode 100644 index 0000000..8a601af --- /dev/null +++ b/slides/mongodb/idx-map2.xml @@ -0,0 +1,4 @@ +<slide> +<title>Back to the map...</title> +<image filename="cities15000.png"/> +</slide> diff --git a/slides/mongodb/idx-multi-key.xml b/slides/mongodb/idx-multi-key.xml new file mode 100644 index 0000000..47e251d --- /dev/null +++ b/slides/mongodb/idx-multi-key.xml @@ -0,0 +1,30 @@ +<slide> +<title>Indexes on multi-value fields</title> + +<blurb>Example:</blurb> +<example> +{ "name" : "Arnhem", "alternatenames" : [ "Arnem", "Arnheim", "Arnhem", ... ] } +</example> + +<blurb>Create as a normal index:</blurb> +<example> +db.cities.ensureIndex( { alternatenames: 1 } ); +</example> + +<blurb>The %isMultiKey% field is set to %true%:</blurb> +<example inline="1"> +db.cities.find( { alternatenames: 'Arnheim' } ).explain(); +{ + "cursor" : "BtreeCursor alternatenames_1", + "nscanned" : 1, + "nscannedObjects" : 1, + "n" : 1, + "millis" : 0, + "nYields" : 0, + "nChunkSkips" : 0, + *"isMultiKey" : true,* +... +</example> +</slide> + + diff --git a/slides/mongodb/idx-recap1.xml b/slides/mongodb/idx-recap1.xml new file mode 100644 index 0000000..d54fb6f --- /dev/null +++ b/slides/mongodb/idx-recap1.xml @@ -0,0 +1,11 @@ +<slide> +<title>Indexes Recap</title> + +<list> + <bullet>MongoDB uses B-trees for indexes</bullet> + <bullet>Many of the principles that apply to an RDBMS also apply to MongoDB</bullet> + <bullet>e.g., indexes require additional work on inserts, updates and deletes</bullet> + <bullet>A collection can have 64 indexes at most</bullet> + <bullet>MongoDB can only use one index per query (with a few exceptions)</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-recap2.xml b/slides/mongodb/idx-recap2.xml new file mode 100644 index 0000000..bd92beb --- /dev/null +++ b/slides/mongodb/idx-recap2.xml @@ -0,0 +1,11 @@ +<slide> +<title>Indexes Recap (2)</title> + +<blurb>Be aware of redundant indexes. Order is important. With an index on<br/> %{ dem: 1, population: 1 }%:</blurb> +<list> + <bullet>You *don't* need an index on %{ dem: 1 }%.</bullet> + <bullet>You *do* need an index on %{ population: 1 }%.</bullet> + <bullet>The index can be used for sorting on *dem* and then *population*, but not on *population* and then *dem*.</bullet> + <bullet>Range search work best if used on the last field only (remember range on *population* and *dem*).</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-recap3.xml b/slides/mongodb/idx-recap3.xml new file mode 100644 index 0000000..9a6fc9c --- /dev/null +++ b/slides/mongodb/idx-recap3.xml @@ -0,0 +1,11 @@ +<slide> +<title>When can indexes not be used?</title> + +<list> + <bullet>Many sorts of negations (%$ne%, %$not%, %$nin%).</bullet> + <bullet>Tricky aritmethic (%$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 dem > population%. In that case, try to pre-compute.</bullet> + <bullet>map/reduce</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-sparse.xml b/slides/mongodb/idx-sparse.xml new file mode 100644 index 0000000..e60979f --- /dev/null +++ b/slides/mongodb/idx-sparse.xml @@ -0,0 +1,19 @@ +<slide> +<title>Sparse Indexes</title> + +<blurb>Index on %admin1_code%:</blurb> +<image filename="mongo-compound-index-null.png"/> +<break/> + +<blurb>A sparse index doesn't contain documents where the field-to-be-indexed is NULL:</blurb> +<div effect="fade-out"> +<image filename="mongo-compound-index-sparse.png"/> +</div> + +<div effect="fade-in"> +<example inline="1"> +db.cities.ensureIndex( { admin1_code: 1 }, *{ sparse: true }* ); +</example> +<image filename="mongo-compound-index-sparse2.png"/> +</div> +</slide> diff --git a/slides/mongodb/idx-sparse2.xml b/slides/mongodb/idx-sparse2.xml new file mode 100644 index 0000000..476b280 --- /dev/null +++ b/slides/mongodb/idx-sparse2.xml @@ -0,0 +1,27 @@ +<slide> +<title>Sparse indexes can have unexpected results</title> + +<example inline="1"> +> db.cities.find( { admin1_code: { $exists: true } } ).count(); +|00cc00|22816| +> db.cities.find( { admin1_code: { $exists: false } } ).count(); +|f10000|0| +> db.cities.count(); +22840 +</example> + +<div effect="fade-in"> +<blurb>Let's look at %explain()%:</blurb> +<example inline="1"> +> db.cities.find( { admin1_code: { $exists: false } } ).explain(); +{ + *"cursor" : "BtreeCursor admin1_code_1",* + "nscanned" : 0, + "nscannedObjects" : 0, + "n" : 0, +... +</example> +<break/> +<blurb>A sparse index doesn't contain the field, so it won't find any documents *without* that field.</blurb> +</div> +</slide> diff --git a/slides/mongodb/idx-startup-quotes.xml b/slides/mongodb/idx-startup-quotes.xml new file mode 100644 index 0000000..54ac862 --- /dev/null +++ b/slides/mongodb/idx-startup-quotes.xml @@ -0,0 +1,4 @@ +<slide> +<blurb class="quote-page">Indexes are the single biggest tunable performance +factor in MongoDB.</blurb> +</slide> diff --git a/slides/mongodb/idx-startup-quotes2.xml b/slides/mongodb/idx-startup-quotes2.xml new file mode 100644 index 0000000..84b0c70 --- /dev/null +++ b/slides/mongodb/idx-startup-quotes2.xml @@ -0,0 +1,4 @@ +<slide> +<blurb class="quote-page">Absent or suboptimal indexes are the most common +avoidable MongoDB performance problem.</blurb> +</slide> diff --git a/slides/mongodb/idx-startup-quotes3.xml b/slides/mongodb/idx-startup-quotes3.xml new file mode 100644 index 0000000..4e6841f --- /dev/null +++ b/slides/mongodb/idx-startup-quotes3.xml @@ -0,0 +1,3 @@ +<slide> +<blurb class="quote-page">So what problem do indexes solve?</blurb> +</slide> diff --git a/slides/mongodb/idx-stored.xml b/slides/mongodb/idx-stored.xml new file mode 100644 index 0000000..a3f6c8f --- /dev/null +++ b/slides/mongodb/idx-stored.xml @@ -0,0 +1,5 @@ +<slide> +<title>Index ordering</title> + +<image filename="mongo-compound-index.png"/> +</slide> diff --git a/slides/mongodb/idx-unique.xml b/slides/mongodb/idx-unique.xml new file mode 100644 index 0000000..b2c0a01 --- /dev/null +++ b/slides/mongodb/idx-unique.xml @@ -0,0 +1,38 @@ +<slide> +<title>Unique indexes</title> + +<blurb>Unique indexes prefer multiple documents to match the same index key:</blurb> + +<example inline="1"> +> db.cities.ensureIndex( { country_code: 1, name: 1 }, *{ unique: true }* ); +</example> + +<div effect="fade-in"> +<example> +E11000 duplicate key error index: +demo.cities.$country_code_1_name_1 dup key: { : "AR", : "Mercedes" } +</example> +</div> + +<div effect="fade-in"> +<blurb>Remove the offending key and try again:</blurb> +<example> +> db.cities.remove( { 'country_code': 'AR', name: 'Mercedes' } ); + +> db.cities.ensureIndex( { country_code: 1, name: 1 }, { unique: true } ); + +E11000 duplicate key error index: +demo.cities.$country_code_1_name_1 dup key: { : "AR", : "San Pedro" } +</example> +</div> + +<div effect="fade-in"> +<blurb>You can force the index with *dropDups* (|f10000|This could delete a lot of data!|):</blurb> + +<example inline="1"> +> db.cities.ensureIndex( { country_code: 1, name: 1 }, + { unique: true, *|f10000|dropDups : true|* } ); +</example> +</div> + +</slide> diff --git a/slides/mongodb/idx-whats-in-store.xml b/slides/mongodb/idx-whats-in-store.xml new file mode 100644 index 0000000..9a5016a --- /dev/null +++ b/slides/mongodb/idx-whats-in-store.xml @@ -0,0 +1,9 @@ +<slide> +<title>What's in store?</title> + +<list> + <bullet>What is indexing?</bullet> + <bullet>Understanding different types of indexes</bullet> + <bullet>Working with indexes in MongoDB</bullet> +</list> +</slide> diff --git a/slides/mongodb/idx-which-one-is-picked.xml b/slides/mongodb/idx-which-one-is-picked.xml new file mode 100644 index 0000000..eac29c7 --- /dev/null +++ b/slides/mongodb/idx-which-one-is-picked.xml @@ -0,0 +1,27 @@ +<slide> +<title>How does MongoDB pick an index?</title> + +<list> + <bullet>MongoDB does not keep statistics</bullet> + <bullet>MongoDB just tries all the possible indexes</bullet> + <bullet>When it has found the fastest one, it remembers it</bullet> + <bullet>MongoDB will re-try all possible plans once in a while</bullet> + <bullet>Indexes can be "hinted": +<example> +db.cities.ensureIndex( { population: 1, dem: 1 } ); +db.cities.ensureIndex( { dem: -1 } ); +db.cities.find( { population: { $gte: 2000000 }, dem: { $gte : 1654 } }) + .sort( { dem: -1 } ) + .hint( { dem: -1 } );</example> +<example inline="1"> +{ + *"cursor" : "BtreeCursor dem_-1",* + *|ff8000|"nscanned" : 614,|* + "nscannedObjects" : 614, + "n" : 6, + "millis" : 2, +... +</example> +</bullet> +</list> +</slide> diff --git a/slides/mongodb/me.xml b/slides/mongodb/me.xml index 3b0cb57..121cb84 100644 --- a/slides/mongodb/me.xml +++ b/slides/mongodb/me.xml @@ -7,9 +7,9 @@ <blurb>Derick Rethans</blurb> <list> <bullet>Dutchman living in London</bullet> - <bullet>PHP mongoDB driver maintainer for 10gen (the company behind mongoDB)</bullet> - <bullet>Author of Xdebug</bullet> - <bullet>Author of the mcrypt, input_filter, dbus, translit and date/time extensions</bullet> + <bullet>One of the PHP MongoDB driver maintainers</bullet> + <bullet>Author of the PHP debugger tool Xdebug, PHP's Date/Time/Timezone support, and a bunch of other PHP extensions</bullet> + <bullet>I ♥ maps</bullet> </list> <div class="footer"> diff --git a/slides/mongodb/mongo-compound-index-null.png b/slides/mongodb/mongo-compound-index-null.png new file mode 100644 index 0000000..1fa5dde Binary files /dev/null and b/slides/mongodb/mongo-compound-index-null.png differ diff --git a/slides/mongodb/mongo-compound-index-sparse.png b/slides/mongodb/mongo-compound-index-sparse.png new file mode 100644 index 0000000..12d8662 Binary files /dev/null and b/slides/mongodb/mongo-compound-index-sparse.png differ diff --git a/slides/mongodb/mongo-compound-index-sparse2.png b/slides/mongodb/mongo-compound-index-sparse2.png new file mode 100644 index 0000000..66927da Binary files /dev/null and b/slides/mongodb/mongo-compound-index-sparse2.png differ diff --git a/slides/mongodb/mongo-compound-index.png b/slides/mongodb/mongo-compound-index.png new file mode 100644 index 0000000..e4dac4b Binary files /dev/null and b/slides/mongodb/mongo-compound-index.png differ diff --git a/slides/mongodb/title.xml b/slides/mongodb/title.xml index 6845b63..1ee61a2 100644 --- a/slides/mongodb/title.xml +++ b/slides/mongodb/title.xml @@ -1,8 +1,6 @@ <slide type="title"> -<title>Welcome!</title> <blurb class="event-title">:-:title:-:</blurb> -<blurb class="event-date">:-:event:-: - :-:location:-:</blurb> -<blurb class="event-date">:-:date:-:</blurb> +<blurb class="event-date">:-:event:-: - :-:location:-: - :-:date:-:</blurb> <blurb class="event-presenter">Derick Rethans - :-:email:-: - twitter: @:-:twitter:-:</blurb> <blurb class="pres-url-small">:-:joindin:-:</blurb> <div class="footer"> diff --git a/templates/default/slide.ezt b/templates/default/slide.ezt index 986c58a..5b45559 100644 --- a/templates/default/slide.ezt +++ b/templates/default/slide.ezt @@ -75,8 +75,9 @@ $('*').keypress(function(event) { </head> {var $img = get_attribute( $node, 'background' )} +{var $maincolor = get_attribute( $node, 'template' )} <body{if $img} style='background-image: url({$pres->base}{$img});'{/if}> -<div class='whole-slide'> +<div class='whole-slide{if $maincolor} template-{$maincolor}{/if}'> {switch ( get_attribute( $node, 'type' ) )} {case 'section'} {include 'slide-section-page.ezt' send $node, $pres, $slideNr}
« previous php.pres (#1818) next »