In the old extension one could get the result count from the cursor using MongoCursor::count(). However, the new cursor MongoDB\Driver\Cursor has no such method. What is the new way of getting the number of results from after performing a query against MongoDB?
You can do it like this
$whereClause would be your search criteria basically.
Otherwise, if your query returns an array, you could do
$data = Model::find(array($whereClause)); $total = count($data);