2. {title : me}
● A Weboniser and a PHP nerd
● MongoDb user
● DevOps
● Love working on Php, and a CakeBaker
3. {title : Content}
● PECL : MongoDb client
● Playing with MongoDb-PHP Client
● Using MongoDB-PHP Client
4. {title : mongoDb-PHP Client}
● Official Library
● Easy and effective to use
● Sweet-Simple-Easy
5. {title : core classes}
The Mongo Client
The MongoDB Class
The Mongo Collection Class
The Mongo Cursor Class
6. {title : connection}
<?php
// connects to localhost:27017
$connection = new MongoClient();
// connect to a remote host (default port: 27017)
$connection = new MongoClient( "mongodb://example.com" );
// connect to a remote host at a given port
$connection = new MongoClient( "mongodb://example.com:65432" );
?>
7. {title : select database}
<?php
$connection = new MongoClient();
$db = $connection->dbname;
?>
: Be careful for the Database you provide..!
8. {title : Collection}
<?php
$connection = new MongoClient();
$db = $connection->meetup;
// select a collection:
$collection = $db->mongodb;
// or, directly selecting a database and collection:
$collection = $connection->meetup->mongodb;
?>