php mongodb get all documents

Solutions on MaxInterview for php mongodb get all documents by the best coders in the world

showing results for - "php mongodb get all documents"
Paola
13 Sep 2016
1<?php
2$connection = new MongoClient();
3$collection = $connection->database->collectionName;
4
5$cursor = $collection->find();
6foreach ( $cursor as $id => $value )
7{
8    echo "$id: ";
9    var_dump( $value );
10}
11?>