我正在尝试根据特定用户电子邮件的类别显示项目数。 这是我的以下PHP代码
$email = $_SESSION['loggedInUserEmail'];
//Connect to MongoDB
$mongoClient = new MongoClient();
//Select a database
$db = $mongoClient->finchest;
$CheckEmail = [
"CustEmail" => $email,
];
$collection = $db->History;
$Criteria = array("Category" => "Fish Skins");
$returnVal = $collection->find($CheckEmail)->count($Criteria);
echo $returnVal;
此代码给我以下错误
警告:MongoCursor :: count()期望参数1为布尔值,在第89行的C:\ www \ FinChest \ PHP \ recommend.php中给出数组。
请帮我解决,谢谢。