MongoCursor::__construct PHP Method

__construct() public method

Create a new cursor
public __construct ( MongoClient $connection, string $ns, array $query = [], array $fields = [] )
$connection MongoClient Database connection.
$ns string Full name of database and collection.
$query array Database query.
$fields array Fields to return.
    public function __construct(MongoClient $connection, $ns, array $query = array(), array $fields = array())
    {
        parent::__construct($connection, $ns);
        $this->query = $query;
        $this->projection = $fields;
    }

Usage Example

Beispiel #1
0
 public function __construct($collection, $className = 'Phalcon\\Db\\Adapter\\Mongo\\Cursor', $query = array(), $fields = array())
 {
     $ns = $collection->db->name . '.' . $collection->getName();
     parent::__construct($collection->db->conn, $ns, $query, $fields);
     $this->collection = $collection;
     $this->className = $className;
 }
All Usage Examples Of MongoCursor::__construct