Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

php mongodb get all documents

<?php
$connection = new MongoClient();
$collection = $connection->database->collectionName;

$cursor = $collection->find();
foreach ( $cursor as $id => $value )
{
    echo "$id: ";
    var_dump( $value );
}
?>
 
PREVIOUS NEXT
Tagged: #php #mongodb #documents
ADD COMMENT
Topic
Name
8+9 =