0
我正在开发使用mongodb & PHP的RESTful API。我使用find函数根据条件检索记录。查找函数返回我mongocursor我已经通过foreach循环迭代到Mongodb:如何用mongocursor检查find函数的计数?
$teams = $mongoDb2->find(array('team_maker_id' => (string)$userid));
$count = count($teams);
我曾尝试计数($队)获得的数据,但它返回我1即使它不包含任何数据。
如何获取$队中的记录数?