<?php
require 'vendor/autoload.php';
$whiskies = (new MongoDB\Client)->dramio->whisky;
// Find one document:
$whisky = $whiskies->*findOne*( [ 'name' => 'Cambus 26' ] );
// Find multiple documents:
$cursor = $whiskies->*find*( [ 'style' => 'single-cask' ] );
// Insert one document:
$whiskies->*insertOne*( [ 'name' => 'Glenfiddich 15' ] );
// Insert multiple documents:
$whiskies->*insertMany*( [
[ 'name' => 'Glenlivet 12' ],
[ 'name' => 'Glenlivet 15' ]
] );
// Update document:
$whiskies->*updateOne*( [ 'slug' => 'cambus-26' ], [ *'$set'* => [ 'age' => 26 ] ] );
// Remove document:
$whiskies->*deleteOne*( [ 'name' => 'Jack Daniels' ] );
?>