public function setUp() { parent::setUp(); $this->document = array('test' => 'test'); $this->conn->selectCollection(self::$dbName, 'users')->insert($this->document); $qb = $this->conn->selectCollection(self::$dbName, 'users')->createQueryBuilder(); $qb->eagerCursor(true); $this->test = $qb->getQuery()->execute(); }
public function setUp() { parent::setUp(); $this->doc1 = ['name' => 'A']; $this->doc2 = ['name' => 'B']; $this->doc3 = ['name' => 'C']; $collection = $this->conn->selectCollection(self::$dbName, 'CursorTest'); $collection->drop(); $collection->insert($this->doc1); $collection->insert($this->doc2); $collection->insert($this->doc3); $this->cursor = $collection->createQueryBuilder()->getQuery()->execute(); $this->cursor->sort(['name' => 1]); }