PHPDaemon\Clients\Mongo\Collection::count PHP Method

count() public method

Counts objects in collection
public count ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, where, col)
return void
    public function count($cb, $p = [])
    {
        $p['col'] = $this->name;
        $this->pool->findCount($p, $cb);
    }

Usage Example

Ejemplo n.º 1
0
 /**
  * @param $ip
  * @param callable $cb
  */
 public function getRecentSignupsFromIP($ip, $cb)
 {
     $this->accounts->count($cb, array('where' => array('ip' => (string) $ip, 'regdate' => array('$gt' => time() - 3600))));
 }