Find, Insert, Update .. MongoDB @ PHP5 VS PHP 7 Example

find php5 vs php7 // PHP 5 $m = new MongoClient(); $db = $m->test; $collection = $db->todos; $cursor = $collection->find(); foreach ($cursor as $document) { echo $document[“name”] . “\n”; } // PHP 7 $m = new MongoDB\Driver\Manager(“mongodb://localhost:27017”); $filter = array(‘x’ => array(‘$gt’ => 1)); $options = array( ‘sort’ => array(‘x’ => -1), ); $query = …