PHP Class Doctrine\MongoDB\Aggregation\Stage\Match

Since: 1.2
Author: alcaeus ([email protected])
Inheritance: extends Doctrine\MongoDB\Aggregation\Stage
显示文件 Open project: doctrine/mongodb Class Usage Examples

Protected Properties

Property Type Description
$query Doctrine\MongoDB\Query\Expr

Public Methods

Method Description
__clone ( )
__construct ( Builder $builder )
addAnd ( array | Expr $expression ) Add one or more $and clauses to the current query.
addNor ( array | Expr $expression ) Add one or more $nor clauses to the current query.
addOr ( array | Expr $expression ) Add one or more $or clauses to the current query.
all ( array $values ) Specify $all criteria for the current field.
debug ( string $name = null ) : mixed Return an array of information about the Builder state for debugging.
elemMatch ( array | Expr $expression ) Specify $elemMatch criteria for the current field.
equals ( mixed $value ) Specify an equality match for the current field.
exists ( boolean $bool ) Specify $exists criteria for the current field.
expr ( ) : Expr Create a new Expr instance that can be used to build partial expressions for other operator methods.
field ( string $field ) Set the current field for building the expression.
geoIntersects ( array | GeoJson\Geometry\Geometry $geometry ) Add $geoIntersects criteria with a GeoJSON geometry to the query.
geoWithin ( GeoJson\Geometry\Geometry $geometry ) Add $geoWithin criteria with a GeoJSON geometry to the query.
geoWithinBox ( float $x1, float $y1, float $x2, float $y2 ) Add $geoWithin criteria with a $box shape to the query.
geoWithinCenter ( float $x, float $y, float $radius ) Add $geoWithin criteria with a $center shape to the query.
geoWithinCenterSphere ( float $x, float $y, float $radius ) Add $geoWithin criteria with a $centerSphere shape to the query.
geoWithinPolygon ( ) Add $geoWithin criteria with a $polygon shape to the query.
getExpression ( )
gt ( mixed $value ) Specify $gt criteria for the current field.
gte ( mixed $value ) Specify $gte criteria for the current field.
in ( array $values ) Specify $in criteria for the current field.
language ( string $language ) Set the $language option for $text criteria.
lt ( mixed $value ) Specify $lt criteria for the current field.
lte ( mixed $value ) Specify $lte criteria for the current field.
maxDistance ( float $maxDistance ) Add $maxDistance criteria to the query.
minDistance ( float $minDistance ) Add $minDistance criteria to the query.
mod ( float | integer $divisor, float | integer $remainder ) Specify $mod criteria for the current field.
not ( array | Expr $expression ) Negates an expression for the current field.
notEqual ( mixed $value ) Specify $ne criteria for the current field.
notIn ( array $values ) Specify $nin criteria for the current field.
range ( mixed $start, mixed $end ) Specify $gte and $lt criteria for the current field.
size ( integer $size ) Specify $size criteria for the current field.
text ( string $search ) Specify $text criteria for the current field.
type ( integer $type ) Specify $type criteria for the current field.

Method Details

__clone() public method

See also: http://php.net/manual/en/language.oop5.cloning.php
public __clone ( )

__construct() public method

public __construct ( Builder $builder )
$builder Doctrine\MongoDB\Aggregation\Builder

addAnd() public method

You can create a new expression using the {@link Builder::matchExpr()} method.
See also: Expr::addAnd()
See also: http://docs.mongodb.org/manual/reference/operator/and/
public addAnd ( array | Expr $expression )
$expression array | Doctrine\MongoDB\Query\Expr

addNor() public method

You can create a new expression using the {@link Builder::matchExpr()} method.
See also: Expr::addNor()
See also: http://docs.mongodb.org/manual/reference/operator/nor/
public addNor ( array | Expr $expression )
$expression array | Doctrine\MongoDB\Query\Expr

addOr() public method

You can create a new expression using the {@link Builder::matchExpr()} method.
See also: Expr::addOr()
See also: http://docs.mongodb.org/manual/reference/operator/or/
public addOr ( array | Expr $expression )
$expression array | Doctrine\MongoDB\Query\Expr

all() public method

Specify $all criteria for the current field.
See also: Expr::all()
See also: http://docs.mongodb.org/manual/reference/operator/all/
public all ( array $values )
$values array

debug() public method

The $name parameter may be used to return a specific key from the internal $query array property. If omitted, the entire array will be returned.
public debug ( string $name = null ) : mixed
$name string
return mixed

elemMatch() public method

You can create a new expression using the {@link Builder::matchExpr()} method.
See also: Expr::elemMatch()
See also: http://docs.mongodb.org/manual/reference/operator/elemMatch/
public elemMatch ( array | Expr $expression )
$expression array | Doctrine\MongoDB\Query\Expr

equals() public method

Specify an equality match for the current field.
See also: Expr::equals()
public equals ( mixed $value )
$value mixed

exists() public method

Specify $exists criteria for the current field.
See also: Expr::exists()
See also: http://docs.mongodb.org/manual/reference/operator/exists/
public exists ( boolean $bool )
$bool boolean

expr() public method

Create a new Expr instance that can be used to build partial expressions for other operator methods.
public expr ( ) : Expr
return Doctrine\MongoDB\Query\Expr $expr

field() public method

Set the current field for building the expression.
See also: Expr::field()
public field ( string $field )
$field string

geoIntersects() public method

The geometry parameter GeoJSON object or an array corresponding to the geometry's JSON representation.
See also: Expr::geoIntersects()
See also: http://docs.mongodb.org/manual/reference/operator/geoIntersects/
public geoIntersects ( array | GeoJson\Geometry\Geometry $geometry )
$geometry array | GeoJson\Geometry\Geometry

geoWithin() public method

The geometry parameter GeoJSON object or an array corresponding to the geometry's JSON representation.
See also: Expr::geoWithin()
See also: http://docs.mongodb.org/manual/reference/operator/geoWithin/
public geoWithin ( GeoJson\Geometry\Geometry $geometry )
$geometry GeoJson\Geometry\Geometry

geoWithinBox() public method

A rectangular polygon will be constructed from a pair of coordinates corresponding to the bottom left and top right corners. Note: the $box operator only supports legacy coordinate pairs and 2d indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes.
See also: Expr::geoWithinBox()
See also: http://docs.mongodb.org/manual/reference/operator/box/
public geoWithinBox ( float $x1, float $y1, float $x2, float $y2 )
$x1 float
$y1 float
$x2 float
$y2 float

geoWithinCenter() public method

Note: the $center operator only supports legacy coordinate pairs and 2d indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes.
See also: Expr::geoWithinCenter()
See also: http://docs.mongodb.org/manual/reference/operator/center/
public geoWithinCenter ( float $x, float $y, float $radius )
$x float
$y float
$radius float

geoWithinCenterSphere() public method

Note: the $centerSphere operator supports both 2d and 2dsphere indexes.
See also: Expr::geoWithinCenterSphere()
See also: http://docs.mongodb.org/manual/reference/operator/centerSphere/
public geoWithinCenterSphere ( float $x, float $y, float $radius )
$x float
$y float
$radius float

geoWithinPolygon() public method

Point coordinates are in x, y order (easting, northing for projected coordinates, longitude, latitude for geographic coordinates). The last point coordinate is implicitly connected with the first. Note: the $polygon operator only supports legacy coordinate pairs and 2d indexes. This cannot be used with 2dsphere indexes and GeoJSON shapes.
See also: Expr::geoWithinPolygon()
See also: http://docs.mongodb.org/manual/reference/operator/polygon/
public geoWithinPolygon ( )

getExpression() public method

public getExpression ( )

gt() public method

Specify $gt criteria for the current field.
See also: Expr::gt()
See also: http://docs.mongodb.org/manual/reference/operator/gt/
public gt ( mixed $value )
$value mixed

gte() public method

Specify $gte criteria for the current field.
See also: Expr::gte()
See also: http://docs.mongodb.org/manual/reference/operator/gte/
public gte ( mixed $value )
$value mixed

in() public method

Specify $in criteria for the current field.
See also: Expr::in()
See also: http://docs.mongodb.org/manual/reference/operator/in/
public in ( array $values )
$values array

language() public method

This method must be called after text().
See also: Expr::language()
See also: http://docs.mongodb.org/manual/reference/operator/text/
public language ( string $language )
$language string

lt() public method

Specify $lt criteria for the current field.
See also: Expr::lte()
See also: http://docs.mongodb.org/manual/reference/operator/lte/
public lt ( mixed $value )
$value mixed

lte() public method

Specify $lte criteria for the current field.
See also: Expr::lte()
See also: http://docs.mongodb.org/manual/reference/operator/lte/
public lte ( mixed $value )
$value mixed

maxDistance() public method

If the query uses GeoJSON points, $maxDistance will be interpreted in meters. If legacy point coordinates are used, $maxDistance will be interpreted in radians.
See also: Expr::maxDistance()
See also: http://docs.mongodb.org/manual/reference/command/geoNear/
See also: http://docs.mongodb.org/manual/reference/operator/maxDistance/
See also: http://docs.mongodb.org/manual/reference/operator/near/
See also: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public maxDistance ( float $maxDistance )
$maxDistance float

minDistance() public method

If the query uses GeoJSON points, $minDistance will be interpreted in meters. If legacy point coordinates are used, $minDistance will be interpreted in radians.
See also: Expr::minDistance()
See also: http://docs.mongodb.org/manual/reference/command/geoNear/
See also: http://docs.mongodb.org/manual/reference/operator/minDistance/
See also: http://docs.mongodb.org/manual/reference/operator/near/
See also: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public minDistance ( float $minDistance )
$minDistance float

mod() public method

Specify $mod criteria for the current field.
See also: Expr::mod()
See also: http://docs.mongodb.org/manual/reference/operator/mod/
public mod ( float | integer $divisor, float | integer $remainder )
$divisor float | integer
$remainder float | integer

not() public method

You can create a new expression using the {@link Builder::matchExpr()} method.
See also: Expr::not()
See also: http://docs.mongodb.org/manual/reference/operator/not/
public not ( array | Expr $expression )
$expression array | Doctrine\MongoDB\Query\Expr

notEqual() public method

Specify $ne criteria for the current field.
See also: Expr::notEqual()
See also: http://docs.mongodb.org/manual/reference/operator/ne/
public notEqual ( mixed $value )
$value mixed

notIn() public method

Specify $nin criteria for the current field.
See also: Expr::notIn()
See also: http://docs.mongodb.org/manual/reference/operator/nin/
public notIn ( array $values )
$values array

range() public method

This method is shorthand for specifying $gte criteria on the lower bound and $lt criteria on the upper bound. The upper bound is not inclusive.
See also: Expr::range()
public range ( mixed $start, mixed $end )
$start mixed
$end mixed

size() public method

Specify $size criteria for the current field.
See also: Expr::size()
See also: http://docs.mongodb.org/manual/reference/operator/size/
public size ( integer $size )
$size integer

text() public method

The $language option may be set with {@link Builder::language()}. You can only use this in the first $match stage of a pipeline.
See also: Expr::text()
See also: http://docs.mongodb.org/master/reference/operator/query/text/
public text ( string $search )
$search string

type() public method

Specify $type criteria for the current field.
See also: Expr::type()
See also: http://docs.mongodb.org/manual/reference/operator/type/
public type ( integer $type )
$type integer

Property Details

$query protected_oe property

protected Expr,Doctrine\MongoDB\Query $query
return Doctrine\MongoDB\Query\Expr