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

find() public method

Finds objects in collection
public find ( callable $cb, array $p = [] ) : void
$cb callable Callback called when response received
$p array Hash of properties (offset, limit, opts, tailable, where, col, fields, sort, hint, explain, snapshot, orderby, parse_oplog)
return void
    public function find($cb, $p = [])
    {
        $p['col'] = $this->name;
        $this->pool->find($p, $cb);
    }

Usage Example

Example #1
0
 /**
  * @param string $user_id
  * @param int $limit
  * @param int $offset
  * @param array $fields
  * @param callable $cb
  */
 public function findWaiting($user_id, $limit, $offset, $fields, $cb = null)
 {
     $this->externalAuthTokens->find($cb, ['limit' => -$limit, 'offset' => $offset, 'fields' => $fields, 'where' => ['uid' => $user_id, 'status' => ['$in' => ['new', 'delayed']]]]);
 }
All Usage Examples Of PHPDaemon\Clients\Mongo\Collection::find