public function testWhereText() { $dbVersion = $this->collection->getDatabase()->getClient()->getDbVersion(); if (version_compare($dbVersion, '2.6', '<=')) { return; } $this->collection->ensureFulltextIndex(array('subject', 'body'), array('subject' => 2, 'body' => 1)); $this->collection->batchInsert(array(array('subject' => 'big brown dog', 'body' => 'walking on street'), array('subject' => 'little pony', 'body' => 'flying among rainbows'))); $documents = $this->collection->find()->whereText('pony')->findAll(); $this->assertEquals(1, count($documents)); $document = current($documents); $this->assertEquals('little pony', $document->subject); }
/** * Return the connection for this cursor. * * @deprecated 1.1 Will be removed for 2.0 * @return Connection */ public function getConnection() { return $this->collection->getDatabase()->getConnection(); }