I am getting an array length of 1 even if my MongoDB collection is blank. I am using PHP and MongoDB.
code :
$listdata=$db->kf_poll_master->find();
echo (count($listdata));exit;
Here my collection: kf_poll_master has no data still the array length is showing 1 in echo where it should come as 0.
var_dump($listdata)it is like nuclear bomb in PHP.object(MongoCursor)#7 (0) { }output. I also did like thisprint_r($listdata)and it gave me thisMongoCursor Object ( )as poupt.