Page 1 of 1

MongoDB + PHP - show the execution stats

Posted: Thu Jan 25, 2018 1:47 am
by Cafcfan123
HI All

I am trying to include the following https://docs.mongodb.com/manual/referen ... d/explain/ would anyone know how to add this into my code below? so it shows the executionstats of the query?

<?php

Code: Select all

// Connecting to server
$m = new MongoDB\Client("mongodb://localhost:27017");
$db=$m->CSV;
$mObj=$db->Schools;
if($mObj->find())
{	
echo "<br>";
      echo "The search time for all school data is ";
      echo "</br>";
}

else{
	echo "some issue";
}
?>