Installation:


pecl install mongodb
echo "extension=mongodb.so" > /etc/php5/cli/conf.d/20-mongodb.ini"

mkdir new-project
cd new-project
composer require mongodb/mongodb
In your script:

<?php
require 'vendor/autoload.php';

$client = new \Mongo\Client;
$collection $client->selectCollection'databasename''collectionname' );
?>