public function testLanguageWithText() { $expr = new Expr(); $expr->text('foo'); $this->assertSame($expr, $expr->language('en')); $this->assertEquals(array('$text' => array('$search' => 'foo', '$language' => 'en')), $expr->getQuery()); }
public function testDiacriticSensitiveFalseRemovesOption() { $expr = new Expr(); $expr->text('foo'); $expr->diacriticSensitive(true); $expr->diacriticSensitive(false); $this->assertEquals(array('$text' => array('$search' => 'foo')), $expr->getQuery()); }
/** * Specify $text criteria for the current field. * * The $language option may be set with {@link Builder::language()}. * * @see Expr::text() * @see http://docs.mongodb.org/master/reference/operator/query/text/ * @param string $search * @return self */ public function text($search) { $this->expr->text($search); return $this; }
/** * Specify $text criteria for the current field. * * The $language option may be set with {@link Builder::language()}. * * You can only use this in the first $match stage of a pipeline. * * @see Expr::text() * @see http://docs.mongodb.org/master/reference/operator/query/text/ * @param string $search * @return $this */ public function text($search) { $this->query->text($search); return $this; }