com presentations: PHP[MiNDS] talk: mongo-phpminds16.xml slides/mongodb/checkin1.png slides/mongodb/checkin2.png slides/mongodb/phplib-crud.xml slides/mongodb/query-side-by-side.xml slides/mongodb/query-title.xml slides/mongodb/replication-title.xml slides/mongodb/replication.jpg
[email protected] (Derick Rethans) Thu, 14 Apr 2016 10:51:18 +0000
| Newsgroups | php.pres |
|---|---|
| Message-ID | <[email protected]> |
Commit: 3cf33e40d4000ebd9bbfb0b2a6b143e7490bd1ff Author: Derick Rethans <[email protected]> Thu, 14 Apr 2016 11:51:18 +0100 Parents: 4e0b0e2d117baf793574d7c138f010fc26ffae4d Branches: master Link: http://git.php.net/?p=presentations.git;a=commitdiff;h=3cf33e40d4000ebd9bbfb0b2a6b143e7490bd1ff Log: PHP[MiNDS] talk Changed paths: A mongo-phpminds16.xml M slides/mongodb/checkin1.png M slides/mongodb/checkin2.png M slides/mongodb/phplib-crud.xml M slides/mongodb/query-side-by-side.xml A slides/mongodb/query-title.xml A slides/mongodb/replication-title.xml A slides/mongodb/replication.jpg Diff: diff --git a/mongo-phpminds16.xml b/mongo-phpminds16.xml new file mode 100644 index 0000000..8837a80 --- /dev/null +++ b/mongo-phpminds16.xml @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="utf-8"?> +<presentation css="10gen-strict.css"> +<topic>mongoDB</topic> +<title>MongoDB Introduction</title> +<event>PHPMiNDS</event> +<location>Nottingham, UK</location> +<date>April 14, 2016</date> +<speaker>Derick Rethans</speaker> +<email>[email protected]</email> +<twitter>derickr</twitter> +<url>http://derickrethans.nl/talks.html</url> +<joindin>http://joind.in/17343</joindin> +<slide>slides/mongodb/title.xml</slide> +<slide>slides/mongodb/me.xml</slide> + +<slide>slides/mongodb/databasefield.xml</slide> +<slide>slides/mongodb/cap.xml</slide> +<slide>slides/mongodb/nosql.xml</slide> + +** Terms ** + +<slide>slides/mongodb/collections-documents.xml</slide> + +<slide>slides/mongodb/document-title.xml</slide> +<slide>slides/mongodb/document-simple.xml</slide> +<slide>slides/mongodb/document-complex.xml</slide> + +<slide>slides/mongodb/collections-title.xml</slide> +<slide>slides/mongodb/collections.xml</slide> + +<slide>slides/mongodb/index-title.xml</slide> +<slide>slides/mongodb/index.xml</slide> + +** From PHP ** + +<slide>slides/mongodb/phplib-title.xml</slide> +<slide>slides/mongodb/new-architecture.xml</slide> +<slide>slides/mongodb/phplib-intro.xml</slide> +<slide>slides/mongodb/phplib-crud.xml</slide> +<slide>slides/mongodb/query-side-by-side.xml</slide> +<slide>slides/mongodb/phplib-index.xml</slide> + +<slide>slides/mongodb/keys-title.xml</slide> +<slide>slides/mongodb/data-model.xml</slide> +<slide>slides/mongodb/considerations.xml</slide> + +Common Patterns + +- RDBMS-normalisation. + +<slide>slides/mongodb/eav.xml</slide> +<slide>slides/mongodb/eav2.xml</slide> +<slide>slides/mongodb/eav3.xml</slide> + +<slide>slides/mongodb/dram-erd.xml</slide> +<slide>slides/mongodb/dram-erd-in-mongo.xml</slide> +<slide>slides/mongodb/whisky-words.xml</slide> +<slide>slides/mongodb/whisky-checking.xml</slide> + +<slide>slides/mongodb/clinks.xml</slide> +<slide>slides/mongodb/clinks1.xml</slide> +<slide>slides/mongodb/clinks2.xml</slide> +<slide>slides/mongodb/clinks3.xml</slide> +<slide>slides/mongodb/clinks4.xml</slide> +<slide>slides/mongodb/clinks5.xml</slide> + +<slide>slides/mongodb/document-validation.xml</slide> + +<slide>slides/mongodb/embed-vs-link.xml</slide> + +<slide>slides/mongodb/index-title.xml</slide> +<slide>slides/mongodb/indexes-new.xml</slide> +<slide>slides/mongodb/indexes-php.xml</slide> +<slide>slides/mongodb/indexes-explain.xml</slide> +<slide>slides/mongodb/indexes-explain2.xml</slide> +<slide>slides/mongodb/indexes-explain3.xml</slide> +<slide>slides/mongodb/indexes-special.xml</slide> + +<!-- REPLICATION --> +<slide>slides/mongodb/replication-title.xml</slide> +<slide>slides/mongodb/repl-features.xml</slide> +<slide>slides/mongodb/repl-works-normal.xml</slide> +<slide>slides/mongodb/repl-eventual-consistency.xml</slide> + +<slide>slides/mongodb/questions.xml</slide> +<slide>slides/mongodb/mongodbworld16.xml</slide> +<slide>slides/mongodb/resources.xml</slide> + +</presentation> diff --git a/slides/mongodb/checkin1.png b/slides/mongodb/checkin1.png index 855e3f0..5f0210f 100644 Binary files a/slides/mongodb/checkin1.png and b/slides/mongodb/checkin1.png differ diff --git a/slides/mongodb/checkin2.png b/slides/mongodb/checkin2.png index 722ea5c..bbc05cf 100644 Binary files a/slides/mongodb/checkin2.png and b/slides/mongodb/checkin2.png differ diff --git a/slides/mongodb/phplib-crud.xml b/slides/mongodb/phplib-crud.xml index ea388fb..c4fe054 100644 --- a/slides/mongodb/phplib-crud.xml +++ b/slides/mongodb/phplib-crud.xml @@ -1,30 +1,30 @@ <slide> <title>MongoDB & PHP: CRUD</title> -<example><![CDATA[<?php +<example inline="1"><![CDATA[<?php require 'vendor/autoload.php'; $whiskies = (new MongoDB\Client)->dramio->whisky; // Find one document: -$whisky = $whiskies->findOne( [ 'name' => 'Cambus 26' ] ); +$whisky = $whiskies->*findOne*( [ 'name' => 'Cambus 26' ] ); // Find multiple documents: -$cursor = $whiskies->find( [ 'style' => 'single-cask' ] ); +$cursor = $whiskies->*find*( [ 'style' => 'single-cask' ] ); // Insert one document: -$whiskies->insertOne( [ 'name' => 'Glenfiddich 15' ] ); +$whiskies->*insertOne*( [ 'name' => 'Glenfiddich 15' ] ); // Insert multiple documents: -$whiskies->insertMany( [ +$whiskies->*insertMany*( [ [ 'name' => 'Glenlivet 12' ], [ 'name' => 'Glenlivet 15' ] ] ); // Update document: -$whiskies->updateOne( [ 'slug' => 'cambus-26' ], [ '$set' => [ 'age' => 26 ] ] ); +$whiskies->*updateOne*( [ 'slug' => 'cambus-26' ], [ *'$set'* => [ 'age' => 26 ] ] ); // Remove document: -$whiskies->deleteOne( [ 'name' => 'Jack Daniels' ] ); +$whiskies->*deleteOne*( [ 'name' => 'Jack Daniels' ] ); ?>]]></example> </slide> diff --git a/slides/mongodb/query-side-by-side.xml b/slides/mongodb/query-side-by-side.xml index ca0a283..8013752 100644 --- a/slides/mongodb/query-side-by-side.xml +++ b/slides/mongodb/query-side-by-side.xml @@ -4,22 +4,30 @@ <example> SELECT * FROM table; -$db->table->find(); +$collection->find( [] ); </example> <example> SELECT foo, bar FROM table; -$db->table->find( [], ['foo', 'bar'] ); +$collection->find( [], [ 'foo' => 1, 'bar' => 1 ] ); </example> <example> SELECT * FROM table WHERE a = 42; -$db->table->find( [ 'a' => 42 ] ); +$collection->find( [ 'a' => 42 ] ); </example> <example> SELECT * FROM table WHERE a = 'whisky' AND b > 18; -$db->table->find( [ 'a' => 'whisky', 'b' => [ '$gt' => 18 ] ] ); +$collection->find( [ 'a' => 'whisky', 'b' => [ '$gt' => 18 ] ] ); +</example> +<example inline="1"> +SELECT * FROM table WHERE a = 'whisky' OR b > 18; + +$collection->find( [ '$or' => *[* + [ 'a' => 'whisky' ], + [ 'b' => [ '$gt' => 18 ] ] +*]* ] ); </example> <example> SELECT * FROM table1 LEFT JOIN table2 ON (table1.a = table2.b); diff --git a/slides/mongodb/query-title.xml b/slides/mongodb/query-title.xml new file mode 100644 index 0000000..580e4d3 --- /dev/null +++ b/slides/mongodb/query-title.xml @@ -0,0 +1,4 @@ +<slide style="title"> +<title>Query Language</title> +<image align="center" filename="queries.jpg" attr="Véronique Debord-Lazaro — https://www.flickr.com/photos/debord/4932655275"/> +</slide> diff --git a/slides/mongodb/replication-title.xml b/slides/mongodb/replication-title.xml new file mode 100644 index 0000000..4909999 --- /dev/null +++ b/slides/mongodb/replication-title.xml @@ -0,0 +1,4 @@ +<slide style="title"> +<title>Replication</title> +<image align="center" filename="replication.jpg"/> +</slide> diff --git a/slides/mongodb/replication.jpg b/slides/mongodb/replication.jpg new file mode 100644 index 0000000..a04724a Binary files /dev/null and b/slides/mongodb/replication.jpg differ