这是查询数据,分页查询数据没问题,就是不知道怎么查询总数
如果有像mysql中的count(*)就好了
php文档
http://php.net/manual/zh/set....
$filter = array(
'age' => ['$gt' => 50]
);
$options = [
'limit' => 20,
'skip' => 10
];
// 查询数据
$query = new \MongoDB\Driver\Query($filter, $options);
$cursor = $this->manager->executeQuery($this->dbname . '.' . $collection, $query);
$rows = $cursor->toArray();
http://php.net/manual/zh/mong...