com presentations: Slides for the MongoDB tutorial at PHPNW 13.: mongo-phpnw13.xml slides/mongodb/commands.xml slides/mongodb/excercise.xml
slides/mongodb/excercise01-whisky-example.xml slides/mongodb/excercise01-whisky-storage.xml slides/mongodb/excercise02-distillers-example.xml
slides/mongodb/excercise02-distillers-storage.xml slides/mongodb/excercise03-add-like.xml slides/mongodb/excercise03-push-to-add-review.xml
slides/mongodb/excercise03-r

From: Date: Thu, 03 Oct 2013 14:11:56 +0000
Subject: com presentations: Slides for the MongoDB tutorial at PHPNW 13.: mongo-phpnw13.xml slides/mongodb/commands.xml slides/mongodb/excercise.xml
slides/mongodb/excercise01-whisky-example.xml slides/mongodb/excercise01-whisky-storage.xml slides/mongodb/excercise02-distillers-example.xml
slides/mongodb/excercise02-distillers-storage.xml slides/mongodb/excercise03-add-like.xml slides/mongodb/excercise03-push-to-add-review.xml
slides/mongodb/excercise03-r
Groups: php.pres 
Request: Send a blank email to pres+get-1916@lists.php.net to get a copy of this message
Commit: a524d954f0b0e4aa56f68638ebded6eb5d1ba544 Author: Derick Rethans <github@derickrethans.nl> Thu, 3 Oct 2013 15:11:56 +0100 Parents: eba7d2dc8168f818c4a979bb5e6d30eb74c3a532 Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=a524d954f0b0e4aa56f68638ebded6eb5d1ba544 Log: Slides for the MongoDB tutorial at PHPNW 13. Changed paths: A mongo-phpnw13.xml M slides/mongodb/commands.xml A slides/mongodb/excercise.xml A slides/mongodb/excercise01-whisky-example.xml A slides/mongodb/excercise01-whisky-storage.xml A slides/mongodb/excercise02-distillers-example.xml A slides/mongodb/excercise02-distillers-storage.xml A slides/mongodb/excercise03-add-like.xml A slides/mongodb/excercise03-push-to-add-review.xml A slides/mongodb/excercise03-reviews-example.xml A slides/mongodb/excercise03-reviews.xml A slides/mongodb/excercise04-reviews-aggr-example.xml A slides/mongodb/excercise04-reviews-aggr.xml M slides/mongodb/id.xml A slides/mongodb/insert-js.xml A slides/mongodb/insert-php-shortarray.xml A slides/mongodb/insert-php.xml M slides/mongodb/insert.xml A slides/mongodb/section-aggregation.xml M xdebug-phpnw13.xml

diff --git a/mongo-phpnw13.xml b/mongo-phpnw13.xml new file mode 100644 index 0000000..db0a891 --- /dev/null +++ b/mongo-phpnw13.xml @@ -0,0 +1,163 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen-strict.css"> +<topic>mongoDB</topic> +<title>Working with MongoDB</title> +<event>PHP NorthWest 2013</event> +<location>Manchester, UK</location> +<date>October 4th, 2013</date> +<speaker>Derick Rethans</speaker> +<email>derick@10gen.com</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>http://joind.in/9324</joindin> +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> +<slide>slides/mongodb/half-tutorial-topics.xml</slide> + +<slide>slides/mongodb/section-intro.xml</slide> +<slide>slides/mongodb/collections-documents.xml</slide> +<slide>slides/mongodb/document.xml</slide> + +<slide>slides/mongodb/connecting.xml</slide> + +<slide>slides/mongodb/insert-js.xml</slide> +<slide>slides/mongodb/insert-php.xml</slide> +<slide>slides/mongodb/insert-php-shortarray.xml</slide> +- single + +<slide>slides/mongodb/id.xml</slide> + +<slide>slides/mongodb/query.xml</slide> +<slide>slides/mongodb/query2.xml</slide> +- findOne +- find + +<slide>slides/mongodb/query-advanced-ops.xml</slide> + +<slide>slides/mongodb/cursors.xml</slide> +- cursor +<slide>slides/mongodb/limit-skip.xml</slide> +- limit/skip + +<slide>slides/mongodb/update2a.xml</slide> + +<!-- FIRST EXCERCISE --> +<slide>slides/mongodb/excercise.xml</slide> +<slide>slides/mongodb/excercise01-whisky-storage.xml</slide> +<slide>slides/mongodb/excercise01-whisky-example.xml</slide> + +<!-- SCHEMA DESIGN --> +<slide>slides/mongodb/section-schema-design.xml</slide> +Common Patterns + +- RDBMS-normalisation. + +<slide>slides/mongodb/blog.xml</slide> +<slide>slides/mongodb/blog2.xml</slide> + +<slide>slides/mongodb/considerations.xml</slide> + + +<slide>slides/mongodb/one-to-many1.xml</slide> +<slide>slides/mongodb/one-to-many2.xml</slide> +<slide>slides/mongodb/tip-array-key.xml</slide> +<slide>slides/mongodb/one-to-many4.xml</slide> + +<!-- SECOND EXCERCISE --> +<slide>slides/mongodb/excercise.xml</slide> +<slide>slides/mongodb/excercise02-distillers-storage.xml</slide> +<slide>slides/mongodb/excercise02-distillers-example.xml</slide> + + +<slide>slides/mongodb/many-to-many1.xml</slide> +<slide>slides/mongodb/many-to-many2.xml</slide> +<slide>slides/mongodb/many-to-many3.xml</slide> +<slide>slides/mongodb/many-to-many4.xml</slide> + +<slide>slides/mongodb/embed-vs-link.xml</slide> + + +<!-- THIRD EXCERCISE --> +<slide>slides/mongodb/excercise.xml</slide> +<slide>slides/mongodb/excercise03-reviews.xml</slide> +<slide>slides/mongodb/excercise03-reviews-example.xml</slide> +<slide>slides/mongodb/excercise03-push-to-add-review.xml</slide> +<slide>slides/mongodb/excercise03-add-like.xml</slide> + + +<!-- COMMANDS and AGGREGATION --> +<slide>slides/mongodb/commands.xml</slide> + +<slide>slides/mongodb/section-aggregation.xml</slide> +<slide>slides/mongodb/aggr-aggr-framework.xml</slide> + +<slide>slides/mongodb/aggr-pipeline.xml</slide> +<slide>slides/mongodb/aggr-pipelines-ops.xml</slide> +<slide>slides/mongodb/aggr-our-example-data.xml</slide> +<slide>slides/mongodb/aggr-op-match.xml</slide> +<slide>slides/mongodb/aggr-op-match-example.xml</slide> +<slide>slides/mongodb/aggr-op-match-with-query-example.xml</slide> +<slide>slides/mongodb/aggr-op-project.xml</slide> +<slide>slides/mongodb/aggr-op-project-incl-excl-example.xml</slide> +<slide>slides/mongodb/aggr-op-project-rename-compute-example.xml</slide> +<slide>slides/mongodb/aggr-op-project-create-sub-example.xml</slide> +<slide>slides/mongodb/aggr-op-group.xml</slide> +<slide>slides/mongodb/aggr-op-group-sum-count-example.xml</slide> +<slide>slides/mongodb/aggr-op-group-collect-example.xml</slide> +<slide>slides/mongodb/aggr-op-group-compound-example.xml</slide> +<slide>slides/mongodb/aggr-op-unwind.xml</slide> +<slide>slides/mongodb/aggr-op-unwind-example.xml</slide> +<slide>slides/mongodb/aggr-op-sort-skip-limit.xml</slide> +<slide>slides/mongodb/aggr-op-sort-example.xml</slide> +<slide>slides/mongodb/aggr-op-limit-example.xml</slide> +<slide>slides/mongodb/aggr-op-skip-example.xml</slide> +<slide>slides/mongodb/aggr-op-sort-limit-skip-example.xml</slide> + +<!-- FOURTH EXCERCISE --> +<slide>slides/mongodb/aggregation-example-cuisine6-sort.xml</slide> +<slide>slides/mongodb/excercise.xml</slide> +<slide>slides/mongodb/excercise04-reviews-aggr.xml</slide> +<slide>slides/mongodb/excercise04-reviews-aggr-example.xml</slide> + +<slide>slides/mongodb/questions.xml</slide> + + +<!-- INDEXES --> +<slide>slides/mongodb/section-indexes.xml</slide> + +<slide>slides/mongodb/idx-create-php.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-cities-by-pop-and-dem.xml</slide> +<slide>slides/mongodb/idx-cities-by-pop-and-dem2.xml</slide> +<slide>slides/mongodb/idx-stored2.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-recap1.xml</slide> +<slide>slides/mongodb/idx-recap2.xml</slide> +<slide>slides/mongodb/idx-recap3.xml</slide> + +<slide>slides/mongodb/idx-which-one-is-picked.xml</slide> +<slide>slides/mongodb/questions.xml</slide> + +<!-- REPLICATION --> +<slide>slides/mongodb/section-replication.xml</slide> +<slide>slides/mongodb/repl-use-cases.xml</slide> +<!-- <slide>slides/mongodb/repl-types-of-outage.xml</slide> --> +<slide>slides/mongodb/repl-features.xml</slide> +<slide>slides/mongodb/repl-works-basic.xml</slide> +<slide>slides/mongodb/repl-works-normal.xml</slide> +<slide>slides/mongodb/repl-works-failover.xml</slide> +<slide>slides/mongodb/repl-oplog.xml</slide> + +<slide>slides/mongodb/replication-setup.xml</slide> + +<slide>slides/mongodb/repl-eventual-consistency.xml</slide> + +<slide>slides/mongodb/questions.xml</slide> +<slide>slides/mongodb/resources.xml</slide> +</presentation> diff --git a/slides/mongodb/commands.xml b/slides/mongodb/commands.xml index 14899f1..db43ef0 100644 --- a/slides/mongodb/commands.xml +++ b/slides/mongodb/commands.xml @@ -3,7 +3,7 @@ <list> <bullet>Are run on the database</bullet> - <bullet>Do *not* return a cursor</bullet> + <bullet>Do not (yet) return a cursor</bullet> <bullet>Return one document</bullet> <bullet>Some commands have helpers in the drivers and shell</bullet> </list> diff --git a/slides/mongodb/excercise.xml b/slides/mongodb/excercise.xml new file mode 100644 index 0000000..9bf7029 --- /dev/null +++ b/slides/mongodb/excercise.xml @@ -0,0 +1,3 @@ +<slide type="section"> +<blurb>Excercise</blurb> +</slide> diff --git a/slides/mongodb/excercise01-whisky-example.xml b/slides/mongodb/excercise01-whisky-example.xml new file mode 100644 index 0000000..0108bd1 --- /dev/null +++ b/slides/mongodb/excercise01-whisky-example.xml @@ -0,0 +1,45 @@ +<slide> +<title>Whisky storage</title> + +<div effect="fade-out"> +<example><![CDATA[ +<?php +$m = new MongoClient; +$d = $m->whisky; +$c = $d->whisky; + +$document = [ + 'name' => 'Glenmorangie', + 'age' => 25, + 'vintage' => 1980, + 'strength' => 46.3, + 'distillery' => 'Glenmorangie', + 'country' => 'Scotland', + 'region' => 'Speyside', +]; +$c->insert( $document ); +?>]]></example> +</div> + +<div effect="fade-in"> +<example><![CDATA[ +<?php +$m = new MongoClient; +$d = $m->whisky; +$c = $d->whisky; + +$document = [ + 'name' => 'Glenmorangie', + 'age' => 25, + 'vintage' => 1980, + 'strength' => 46.3, + 'distillery' => [ + 'name' => 'Glenmorangie', + 'country' => 'Scotland', + 'region' => 'Speyside', + ], +]; +$c->insert( $document ); +?>]]></example> +</div> +</slide> diff --git a/slides/mongodb/excercise01-whisky-storage.xml b/slides/mongodb/excercise01-whisky-storage.xml new file mode 100644 index 0000000..99fcf8f --- /dev/null +++ b/slides/mongodb/excercise01-whisky-storage.xml @@ -0,0 +1,16 @@ +<slide> +<title>Whisky storage</title> + +<blurb>Write a PHP script that stores information about a whisky. The +information that you need to store is:</blurb> + +<list> + <bullet>The name</bullet> + <bullet>The age (if available)</bullet> + <bullet>The bottling year (if available)</bullet> + <bullet>The strength (alcohol %)</bullet> + <bullet>The name of the distillery</bullet> + <bullet>The country of the distillery</bullet> + <bullet>The region of the distillery, if applicable (Highlands, Lowlands, Speyside)</bullet> +</list> +</slide> diff --git a/slides/mongodb/excercise02-distillers-example.xml b/slides/mongodb/excercise02-distillers-example.xml new file mode 100644 index 0000000..daafea6 --- /dev/null +++ b/slides/mongodb/excercise02-distillers-example.xml @@ -0,0 +1,38 @@ +<slide> +<title>Distilleries: result</title> + +<div effect="fade-out"> +<blurb>Collection: distillery</blurb> +<example><![CDATA[{ + name: "Glenfiddch", + country: "Scotland", + region: "Speyside", + opening_year: 1887, + whiskies: [ "Glenfiddich 15", "Glenfiddich 18", "Glenfiddich 21" ] +}]]></example> +<blurb>Collection: whisky</blurb> +<example><![CDATA[{ + name: "Glenfiddch 15", + age: 15, + strength: 50.3 +}]]></example> +</div> + +<div effect="fade-in"> +<blurb>Collection: distillery</blurb> +<example><![CDATA[{ + name: "Glenfiddch", + country: "Scotland", + region: "Speyside", + opening_year: 1887 +}]]></example> +<blurb>Collection: whisky</blurb> +<example><![CDATA[{ + name: "Glenfiddch 15", + age: 15, + strength: 50.3, + distillery: "Glenfiddich" +}]]></example> +</div> + +</slide> diff --git a/slides/mongodb/excercise02-distillers-storage.xml b/slides/mongodb/excercise02-distillers-storage.xml new file mode 100644 index 0000000..fd3120a --- /dev/null +++ b/slides/mongodb/excercise02-distillers-storage.xml @@ -0,0 +1,15 @@ +<slide> +<title>Distilleries</title> + +<blurb>A distillery has many whiskies. Design a schema that stores +information about whiskies, and about distilleries and the whiskies they make. +<br/><br/> +Information to store is: +</blurb> +<list> + <bullet>Distillery: country, region (optional), name, opening year</bullet> + <bullet>Whisky: name, age, strength, vintage (optional)</bullet> + <bullet>The relation between them</bullet> +</list> + +</slide> diff --git a/slides/mongodb/excercise03-add-like.xml b/slides/mongodb/excercise03-add-like.xml new file mode 100644 index 0000000..426e349 --- /dev/null +++ b/slides/mongodb/excercise03-add-like.xml @@ -0,0 +1,28 @@ +<slide> +<title>Adding a review</title> + +<example><![CDATA[{ + name: "Glenfiddich 15", + notes: [ + { + user_name: "Derick", + date: 2013-10-02, + note: "Caramel and honey, fruity with some hints of earth", + likes: 17 + rating: 3, + } + ] +}]]></example> + +<div effect="fade-in"> +<example><![CDATA[<?php +$m = new MongoClient; +$c = $m->demo->whisky; + +$c->update( + array( 'name' => 'Glenfiddich 15', 'user_name' => 'Derick' ), + array( '$inc => array( 'notes.$.likes' => 1 ) ) +); +?>]]></example> +</div> +</slide> diff --git a/slides/mongodb/excercise03-push-to-add-review.xml b/slides/mongodb/excercise03-push-to-add-review.xml new file mode 100644 index 0000000..9578143 --- /dev/null +++ b/slides/mongodb/excercise03-push-to-add-review.xml @@ -0,0 +1,35 @@ +<slide> +<title>Adding a review</title> + +<example><![CDATA[{ + name: "Glenfiddich 15", + notes: [ + { + user_name: "Derick", + date: 2013-10-02, + note: "Caramel and honey, fruity with some hints of earth", + likes: 17 + rating: 3, + } + ] +}]]></example> + +<div effect="fade-in-out"> +<example><![CDATA[<?php +$m = new MongoClient; +$c = $m->demo->whisky; + +$newReview = array( + user_name => "Michael", + date => 2013-10-01, + note => "No peat, but fruity", + rating => 1, +); + +$c->update( + array( 'name' => 'Glenfiddich 15' ), + array( '$push => array( 'notes' => $newReview ) ) +); +?>]]></example> +</div> +</slide> diff --git a/slides/mongodb/excercise03-reviews-example.xml b/slides/mongodb/excercise03-reviews-example.xml new file mode 100644 index 0000000..22ae959 --- /dev/null +++ b/slides/mongodb/excercise03-reviews-example.xml @@ -0,0 +1,73 @@ +<slide> +<title>Tasting notes</title> + +<div effect="fade-out"> +<blurb>Collection: whisky</blurb> +<example><![CDATA[{ + name: "Glenfiddch 15", + age: 15, + strength: 50.3, +}]]></example> +<blurb>Collection: user</blurb> +<example><![CDATA[{ + name: "Derick", + country: "England" +}]]></example> +<blurb>Collection: notes</blurb> +<example><![CDATA[{ + user_name: "Derick", + whisky_name: "Glenfiddich 15", + date: 2013-10-02, + note: "Caramel and honey, fruity with some hints of earth", + likes: 17, + rating: 3, +}]]></example> +</div> + +<div effect="fade-in-out"> +<blurb>Collection: whisky</blurb> +<example><![CDATA[{ + name: "Glenfiddch 15", + age: 15, + strength: 50.3, +}]]></example> +<blurb>Collection: user</blurb> +<example><![CDATA[{ + name: "Derick", + country: "England", + tasting_notes: [ + { + whisky_name: "Glenfiddich 15", + date: 2013-10-02, + note: "Caramel and honey, fruity with some hints of earth", + likes: 17 + rating: 3, + } + ] +}]]></example> +</div> + +<div effect="fade-in"> +<blurb>Collection: whisky</blurb> +<example><![CDATA[{ + name: "Glenfiddch 15", + age: 15, + strength: 50.3, + notes: [ + { + user_name: "Derick", + date: 2013-10-02, + note: "Caramel and honey, fruity with some hints of earth", + likes: 17 + rating: 3, + } + ] +}]]></example> +<blurb>Collection: user</blurb> +<example><![CDATA[{ + name: "Derick", + country: "England" +}]]></example> +</div> + +</slide> diff --git a/slides/mongodb/excercise03-reviews.xml b/slides/mongodb/excercise03-reviews.xml new file mode 100644 index 0000000..ea01f27 --- /dev/null +++ b/slides/mongodb/excercise03-reviews.xml @@ -0,0 +1,12 @@ +<slide> +<title>Tasting notes</title> + +<blurb>Tasting notes is like "review" of how whisky tastes. Each user +can have a note for each whisky. Design a schema that allows for:</blurb> + +<list> + <bullet>User profiles: name, country</bullet> + <bullet>Whiskies: name, age, etc (ignore the distillery bit)</bullet> + <bullet>Tasting notes: date, text, likes, and rating</bullet> +</list> +</slide> diff --git a/slides/mongodb/excercise04-reviews-aggr-example.xml b/slides/mongodb/excercise04-reviews-aggr-example.xml new file mode 100644 index 0000000..c0b5645 --- /dev/null +++ b/slides/mongodb/excercise04-reviews-aggr-example.xml @@ -0,0 +1,30 @@ +<slide> +<title>Excercise: Aggregation</title> + +<example><![CDATA[<?php +ini_set('xdebug.var_display_max_depth', 4); +$m = new MongoClient; +$c = $m->demo->whisky; + +$name = 'Michael'; + +$res = $c->aggregate( [ + [ '$match' => [ 'notes.user_name' => $name ] ], + [ '$unwind' => '$notes' ], + [ '$match' => [ 'notes.user_name' => $name ] ], + [ '$group' => [ + '_id' => '$notes.user_name', + 'notes' => [ + '$addToSet' => [ + 'whisky' => '$name', + 'note' => '$notes.note', + 'rating' => '$notes.rating' + ] + ] + ] ], + [ '$sort' => [ 'notes.rating' => -1 ] ], +] ); + +var_dump( $res['result'] ); +?>]]></example> +</slide> diff --git a/slides/mongodb/excercise04-reviews-aggr.xml b/slides/mongodb/excercise04-reviews-aggr.xml new file mode 100644 index 0000000..353a054 --- /dev/null +++ b/slides/mongodb/excercise04-reviews-aggr.xml @@ -0,0 +1,35 @@ +<slide> +<title>Excercise: Aggregation</title> + +<blurb>http://pastebin.com/rzYUULs2</blurb> + +<div effect="fade-out"> +<example><![CDATA[{ + name: "Glenfiddich 15", + notes: [ + { + user_name: "Derick", likes: 17, rating: 3.5, + note: "Caramel and honey, fruity with some hints of earth", + }, + { + user_name: "Michael", likes: 9, rating: 3, + note: "Fruity and oaky", + } + ] +}, +{ + name: "Lagavullin 16", + notes: [ + { + user_name: "Michael", likes: 7, rating: 4.5, + note: "Earty and full of nice peat smoke", + }, + ] +}]]></example> +</div> + +<div effect="fade-in"> +<blurb>Write a script that uses the Aggregation Framework to list all review for a user +sorted on rating</blurb> +</div> +</slide> diff --git a/slides/mongodb/id.xml b/slides/mongodb/id.xml index f28c9fe..046d3fa 100644 --- a/slides/mongodb/id.xml +++ b/slides/mongodb/id.xml @@ -3,7 +3,7 @@ <list> <bullet>Every document needs a unique ID</bullet> - <bullet>ID consists of: 4 bytes timestamp, 3 byte machine id, 2 bytes PID and 3 bytes counter: %|ff9999|507e6384| |99ff99|44670a| |9999ff|3e6e| |ffff99|000000|%</bullet> + <bullet>ID consists of: 4 bytes timestamp, 3 byte machine id, 2 bytes PID and 3 bytes counter:<br/>%|994444|507e6384| |449944|44670a| |444499|3e6e| |999944|000000|%</bullet> </list> <example result="1" stop="true"><![CDATA[<?php diff --git a/slides/mongodb/insert-js.xml b/slides/mongodb/insert-js.xml new file mode 100644 index 0000000..a4348c4 --- /dev/null +++ b/slides/mongodb/insert-js.xml @@ -0,0 +1,20 @@ +<slide> +<title>Inserting a document (JavaScript)</title> +<example> + +{ + "_id" : "derickr", + "name" : "Derick Rethans", + "talks" : [ + { + "title" : "Profiling PHP Applications", + "url" : "http://derickrethans.nl/talks/profiling-phptour.pdf", + }, + { + "title" : "Xdebug", + "url" : "http://derickrethans.nl/talks/xdebug-phpbcn11.pdf", + } + ] +} +</example> +</slide> diff --git a/slides/mongodb/insert-php-shortarray.xml b/slides/mongodb/insert-php-shortarray.xml new file mode 100644 index 0000000..90c2b58 --- /dev/null +++ b/slides/mongodb/insert-php-shortarray.xml @@ -0,0 +1,24 @@ +<slide> +<title>Inserting a document (short array)</title> + +<example result="1"><![CDATA[<?php +$document = [ + "_id" => "derickr", + "name" => "Derick Rethans", + "talks" => [ + [ + "title" => "Profiling PHP Applications", + "url" => "http://derickrethans.nl/talks/profiling-phptour.pdf", + ], + [ + "title" => "Xdebug", + "url" => "http://derickrethans.nl/talks/xdebug-phpbcn11.pdf", + ] + ] +]; + +$m = new MongoClient(); +$c = $m->demo->talks; $c->drop(); +var_dump( $c->insert( $document ) ); +?>]]></example> +</slide> diff --git a/slides/mongodb/insert-php.xml b/slides/mongodb/insert-php.xml new file mode 100644 index 0000000..97d8c48 --- /dev/null +++ b/slides/mongodb/insert-php.xml @@ -0,0 +1,23 @@ +<slide> +<title>Inserting a document</title> + +<example result="0"><![CDATA[<?php +$document = array( + "_id" => "derickr", + "name" => "Derick Rethans", + "talks" => array( + array( + "title" => "Profiling PHP Applications", + "url" => "http://derickrethans.nl/talks/profiling-phptour.pdf", + ), + array( + "title" => "Xdebug", + "url" => "http://derickrethans.nl/talks/xdebug-phpbcn11.pdf", + ) + ) +); + +$m = new MongoClient(); +var_dump( $m->demo->talks->insert( $document ) ); +?>]]></example> +</slide> diff --git a/slides/mongodb/insert.xml b/slides/mongodb/insert.xml index be337ce..fb24a33 100644 --- a/slides/mongodb/insert.xml +++ b/slides/mongodb/insert.xml @@ -44,6 +44,7 @@ var_dump( $m->demo->talks->insert( $document ) ); <div effect="fade-in"> <example result="1" stop="true"><![CDATA[<?php +ini_set('display_errors', 1); $document = [ "_id" => "derickr", "name" => "Derick Rethans", diff --git a/slides/mongodb/section-aggregation.xml b/slides/mongodb/section-aggregation.xml new file mode 100644 index 0000000..9ba8204 --- /dev/null +++ b/slides/mongodb/section-aggregation.xml @@ -0,0 +1,3 @@ +<slide type="section"> +<blurb>Aggregation</blurb> +</slide> diff --git a/xdebug-phpnw13.xml b/xdebug-phpnw13.xml index 393a4b9..4cd68c7 100644 --- a/xdebug-phpnw13.xml +++ b/xdebug-phpnw13.xml @@ -4,7 +4,7 @@ <title>Getting the most out of Xdebug</title> <event>PHP Northwest 2013</event> <location>Manchester, UK</location> -<date>Sep 20th, 2013</date> +<date>October 5th, 2013</date> <speaker>Derick Rethans</speaker> <email>derick@mongodb.com</email> <twitter>derickr</twitter>
« previous php.pres (#1916) next »