PHP Class Doctrine\MongoDB\Query\Expr

Since: 1.0
Author: Jonathan H. Wage ([email protected])
Mostra file Open project: doctrine/mongodb Class Usage Examples

Protected Properties

Property Type Description
$currentField string The current field we are operating on.
$newObj array The "new object" array containing either a full document or a number of atomic update operators.
$query string The query criteria array.

Public Methods

Method Description
addAnd ( array | Expr $expression ) Add one or more $and clauses to the current query.
addManyToSet ( array $values ) Append multiple values to the current array field only if they do not already exist in the array.
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.
addToSet ( mixed | Expr $valueOrExpression ) Append one or more values to the current array field only if they do not already exist in the array.
all ( array $values ) Specify $all criteria for the current field.
bitAnd ( integer $value ) Apply a bitwise and operation on the current field.
bitOr ( integer $value ) Apply a bitwise or operation on the current field.
bitXor ( integer $value ) Apply a bitwise xor operation on the current field.
bitsAllClear ( integer | array | MongoBinData $value ) Matches documents where all of the bit positions given by the query are clear.
bitsAllSet ( integer | array | MongoBinData $value ) Matches documents where all of the bit positions given by the query are set.
bitsAnyClear ( integer | array | MongoBinData $value ) Matches documents where any of the bit positions given by the query are clear.
bitsAnySet ( integer | array | MongoBinData $value ) Matches documents where any of the bit positions given by the query are set.
caseSensitive ( boolean $caseSensitive ) A boolean flag to enable or disable case sensitive search for $text criteria.
comment ( string $comment ) Associates a comment to any expression taking a query predicate.
currentDate ( string $type = 'date' ) Sets the value of the current field to the current date, either as a date or a timestamp.
diacriticSensitive ( boolean $diacriticSensitive ) A boolean flag to enable or disable diacritic sensitive search for $text criteria.
each ( array $values ) Add $each criteria to the expression for a $push operation.
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.
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 expression.
geoWithin ( array | GeoJson\Geometry\Geometry $geometry ) Add $geoWithin criteria with a GeoJSON geometry to the expression.
geoWithinBox ( float $x1, float $y1, float $x2, float $y2 ) Add $geoWithin criteria with a $box shape to the expression.
geoWithinCenter ( float $x, float $y, float $radius ) Add $geoWithin criteria with a $center shape to the expression.
geoWithinCenterSphere ( float $x, float $y, float $radius ) Add $geoWithin criteria with a $centerSphere shape to the expression.
geoWithinPolygon ( ) Add $geoWithin criteria with a $polygon shape to the expression.
getCurrentField ( ) : string Return the current field.
getNewObj ( ) : array Return the "new object".
getQuery ( ) : array Return the query criteria.
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.
inc ( float | integer $value ) Increment 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.
max ( mixed $value ) Updates the value of the field to a specified value if the specified value is greater than the current value of the field.
maxDistance ( float $maxDistance ) Set the $maxDistance option for $near or $nearSphere criteria.
min ( mixed $value ) Updates the value of the field to a specified value if the specified value is less than the current value of the field.
minDistance ( float $minDistance ) Set the $minDistance option for $near or $nearSphere criteria.
mod ( float | integer $divisor, float | integer $remainder ) Specify $mod criteria for the current field.
mul ( float | integer $value ) Multiply the current field.
near ( float | array | GeoJson\Geometry\Point $x, float $y = null ) Add $near criteria to the expression.
nearSphere ( float | array | GeoJson\Geometry\Point $x, float $y = null ) Add $nearSphere criteria to the expression.
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.
operator ( string $operator, mixed $value ) Defines an operator and value on the expression.
popFirst ( ) Remove the first element from the current array field.
popLast ( ) Remove the last element from the current array field.
position ( integer $position ) Add $position criteria to the expression for a $push operation.
pull ( mixed | Expr $valueOrExpression ) Remove all elements matching the given value or expression from the current array field.
pullAll ( array $values ) Remove all elements matching any of the given values from the current array field.
push ( mixed | Expr $valueOrExpression ) Append one or more values to the current array field.
pushAll ( array $values ) Append multiple values to the current array field.
range ( mixed $start, mixed $end ) Specify $gte and $lt criteria for the current field.
rename ( string $name ) Rename the current field.
set ( mixed $value, boolean $atomic = true ) Set the current field to a value.
setNewObj ( array $newObj ) Set the "new object".
setOnInsert ( mixed $value ) Set the current field to the value if the document is inserted in an upsert operation.
setQuery ( array $query ) Set the query criteria.
size ( integer $size ) Specify $size criteria for the current field.
slice ( integer $slice ) Add $slice criteria to the expression for a $push operation.
sort ( array | string $fieldName, integer | string $order = null ) Add $sort criteria to the expression for a $push operation.
text ( string $search ) Specify $text criteria for the current query.
type ( integer $type ) Specify $type criteria for the current field.
unsetField ( ) Unset the current field.
where ( string | MongoCode $javascript ) Specify a JavaScript expression to use for matching documents.
withinBox ( float $x1, float $y1, float $x2, float $y2 ) Add $within criteria with a $box shape to the expression.
withinCenter ( float $x, float $y, float $radius ) Add $within criteria with a $center shape to the expression.
withinCenterSphere ( float $x, float $y, float $radius ) Add $within criteria with a $centerSphere shape to the expression.
withinPolygon ( ) Add $within criteria with a $polygon shape to the expression.

Protected Methods

Method Description
bit ( string $operator, integer $value ) Apply a bitwise operation on the current field

Private Methods

Method Description
requiresCurrentField ( ) Ensure that a current field has been set.
wrapEqualityCriteria ( ) Wraps equality criteria with an operator.

Method Details

addAnd() public method

Add one or more $and clauses to the current query.
See also: Builder::addAnd()
See also: http://docs.mongodb.org/manual/reference/operator/and/
public addAnd ( array | Expr $expression )
$expression array | Expr

addManyToSet() public method

If the field does not exist, it will be set to an array containing the unique values in the argument. If the field is not an array, the query will yield an error.
See also: Builder::addManyToSet()
See also: http://docs.mongodb.org/manual/reference/operator/addToSet/
See also: http://docs.mongodb.org/manual/reference/operator/each/
Deprecation: 1.1 Use {@link Expr::addToSet()} with {@link Expr::each()}; Will be removed in 2.0
public addManyToSet ( array $values )
$values array

addNor() public method

Add one or more $nor clauses to the current query.
See also: Builder::addNor()
See also: http://docs.mongodb.org/manual/reference/operator/nor/
public addNor ( array | Expr $expression )
$expression array | Expr

addOr() public method

Add one or more $or clauses to the current query.
See also: Builder::addOr()
See also: http://docs.mongodb.org/manual/reference/operator/or/
public addOr ( array | Expr $expression )
$expression array | Expr

addToSet() public method

If the field does not exist, it will be set to an array containing the unique value(s) in the argument. If the field is not an array, the query will yield an error. Multiple values may be specified by provided an Expr object and using {@link Expr::each()}.
See also: Builder::addToSet()
See also: http://docs.mongodb.org/manual/reference/operator/addToSet/
See also: http://docs.mongodb.org/manual/reference/operator/each/
public addToSet ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

all() public method

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

bit() protected method

Apply a bitwise operation on the current field
See also: http://docs.mongodb.org/manual/reference/operator/update/bit/
protected bit ( string $operator, integer $value )
$operator string
$value integer

bitAnd() public method

Apply a bitwise and operation on the current field.
See also: Builder::bitAnd()
See also: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitAnd ( integer $value )
$value integer

bitOr() public method

Apply a bitwise or operation on the current field.
See also: Builder::bitOr()
See also: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitOr ( integer $value )
$value integer

bitXor() public method

Apply a bitwise xor operation on the current field.
See also: Builder::bitXor()
See also: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitXor ( integer $value )
$value integer

bitsAllClear() public method

Matches documents where all of the bit positions given by the query are clear.
See also: Builder::bitsAllClear()
See also: https://docs.mongodb.org/manual/reference/operator/query/bitsAllClear/
public bitsAllClear ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAllSet() public method

Matches documents where all of the bit positions given by the query are set.
See also: Builder::bitsAllSet()
See also: https://docs.mongodb.org/manual/reference/operator/query/bitsAllSet/
public bitsAllSet ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAnyClear() public method

Matches documents where any of the bit positions given by the query are clear.
See also: Builder::bitsAnyClear()
See also: https://docs.mongodb.org/manual/reference/operator/query/bitsAnyClear/
public bitsAnyClear ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAnySet() public method

Matches documents where any of the bit positions given by the query are set.
See also: Builder::bitsAnySet()
See also: https://docs.mongodb.org/manual/reference/operator/query/bitsAnySet/
public bitsAnySet ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

caseSensitive() public method

This method must be called after text().
See also: Builder::caseSensitive()
See also: http://docs.mongodb.org/manual/reference/operator/text/
Since: 1.3
public caseSensitive ( boolean $caseSensitive )
$caseSensitive boolean

comment() public method

Associates a comment to any expression taking a query predicate.
See also: Builder::comment()
See also: http://docs.mongodb.org/manual/reference/operator/query/comment/
public comment ( string $comment )
$comment string

currentDate() public method

Sets the value of the current field to the current date, either as a date or a timestamp.
See also: Builder::currentDate()
See also: http://docs.mongodb.org/manual/reference/operator/update/currentDate/
public currentDate ( string $type = 'date' )
$type string

diacriticSensitive() public method

This method must be called after text().
See also: Builder::diacriticSensitive()
See also: http://docs.mongodb.org/manual/reference/operator/text/
Since: 1.3
public diacriticSensitive ( boolean $diacriticSensitive )
$diacriticSensitive boolean

each() public method

Add $each criteria to the expression for a $push operation.
See also: Expr::push()
See also: http://docs.mongodb.org/manual/reference/operator/each/
public each ( array $values )
$values array

elemMatch() public method

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

equals() public method

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

exists() public method

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

field() public method

Set the current field for building the expression.
See also: Builder::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: Builder::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: Builder::geoWithin()
See also: http://docs.mongodb.org/manual/reference/operator/geoIntersects/
public geoWithin ( array | GeoJson\Geometry\Geometry $geometry )
$geometry array | 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: Builder::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: Builider::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: Builder::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: Builder::geoWithinPolygon()
See also: http://docs.mongodb.org/manual/reference/operator/polygon/
public geoWithinPolygon ( )

getCurrentField() public method

Return the current field.
public getCurrentField ( ) : string
return string

getNewObj() public method

Return the "new object".
See also: Builder::getNewObj()
public getNewObj ( ) : array
return array

getQuery() public method

Return the query criteria.
See also: Builder::getQueryArray()
public getQuery ( ) : array
return array

gt() public method

Specify $gt criteria for the current field.
See also: Builder::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: Builder::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: Builder::in()
See also: http://docs.mongodb.org/manual/reference/operator/in/
public in ( array $values )
$values array

inc() public method

If the field does not exist, it will be set to this value.
See also: Builder::inc()
See also: http://docs.mongodb.org/manual/reference/operator/inc/
public inc ( float | integer $value )
$value float | integer

language() public method

This method must be called after text().
See also: Builder::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: Builder::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: Builder::lte()
See also: http://docs.mongodb.org/manual/reference/operator/lte/
public lte ( mixed $value )
$value mixed

max() public method

Updates the value of the field to a specified value if the specified value is greater than the current value of the field.
See also: Builder::max()
See also: http://docs.mongodb.org/manual/reference/operator/update/max/
public max ( mixed $value )
$value mixed

maxDistance() public method

This method must be called after near() or nearSphere(), since placement of the $maxDistance option depends on whether a GeoJSON point or legacy coordinates were provided for $near/$nearSphere.
See also: http://docs.mongodb.org/manual/reference/operator/maxDistance/
public maxDistance ( float $maxDistance )
$maxDistance float

min() public method

Updates the value of the field to a specified value if the specified value is less than the current value of the field.
See also: Builder::min()
See also: http://docs.mongodb.org/manual/reference/operator/update/min/
public min ( mixed $value )
$value mixed

minDistance() public method

This method must be called after near() or nearSphere(), since placement of the $minDistance option depends on whether a GeoJSON point or legacy coordinates were provided for $near/$nearSphere.
See also: http://docs.mongodb.org/manual/reference/operator/minDistance/
public minDistance ( float $minDistance )
$minDistance float

mod() public method

Specify $mod criteria for the current field.
See also: Builder::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

mul() public method

If the field does not exist, it will be set to 0.
See also: Builder::mul()
See also: http://docs.mongodb.org/manual/reference/operator/mul/
public mul ( float | integer $value )
$value float | integer

near() public method

A GeoJSON point may be provided as the first and only argument for 2dsphere queries. This single parameter may be a GeoJSON point object or an array corresponding to the point's JSON representation.
See also: Builder::near()
See also: http://docs.mongodb.org/manual/reference/operator/near/
public near ( float | array | GeoJson\Geometry\Point $x, float $y = null )
$x float | array | GeoJson\Geometry\Point
$y float

nearSphere() public method

A GeoJSON point may be provided as the first and only argument for 2dsphere queries. This single parameter may be a GeoJSON point object or an array corresponding to the point's JSON representation.
See also: Builder::nearSphere()
See also: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public nearSphere ( float | array | GeoJson\Geometry\Point $x, float $y = null )
$x float | array | GeoJson\Geometry\Point
$y float

not() public method

Negates an expression for the current field.
See also: Builder::not()
See also: http://docs.mongodb.org/manual/reference/operator/not/
public not ( array | Expr $expression )
$expression array | Expr

notEqual() public method

Specify $ne criteria for the current field.
See also: Builder::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: Builder::notIn()
See also: http://docs.mongodb.org/manual/reference/operator/nin/
public notIn ( array $values )
$values array

operator() public method

If there is a current field, the operator will be set on it; otherwise, the operator is set at the top level of the query.
public operator ( string $operator, mixed $value )
$operator string
$value mixed

popFirst() public method

Remove the first element from the current array field.
See also: Builder::popFirst()
See also: http://docs.mongodb.org/manual/reference/operator/pop/
public popFirst ( )

popLast() public method

Remove the last element from the current array field.
See also: Builder::popLast()
See also: http://docs.mongodb.org/manual/reference/operator/pop/
public popLast ( )

position() public method

This is useful in conjunction with {@link Expr::each()} for a {@link Expr::push()} operation.
See also: http://docs.mongodb.org/manual/reference/operator/update/position/
public position ( integer $position )
$position integer

pull() public method

Remove all elements matching the given value or expression from the current array field.
See also: Builder::pull()
See also: http://docs.mongodb.org/manual/reference/operator/pull/
public pull ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

pullAll() public method

Remove all elements matching any of the given values from the current array field.
See also: Builder::pullAll()
See also: http://docs.mongodb.org/manual/reference/operator/pullAll/
public pullAll ( array $values )
$values array

push() public method

If the field does not exist, it will be set to an array containing the value(s) in the argument. If the field is not an array, the query will yield an error. Multiple values may be specified by providing an Expr object and using {@link Expr::each()}. {@link Expr::slice()} and {@link Expr::sort()} may also be used to limit and order array elements, respectively.
See also: Builder::push()
See also: http://docs.mongodb.org/manual/reference/operator/push/
See also: http://docs.mongodb.org/manual/reference/operator/each/
See also: http://docs.mongodb.org/manual/reference/operator/slice/
See also: http://docs.mongodb.org/manual/reference/operator/sort/
public push ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

pushAll() public method

If the field does not exist, it will be set to an array containing the values in the argument. If the field is not an array, the query will yield an error. This operator is deprecated in MongoDB 2.4. {@link Expr::push()} and {@link Expr::each()} should be used in its place.
See also: Builder::pushAll()
See also: http://docs.mongodb.org/manual/reference/operator/pushAll/
public pushAll ( 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: Builder::range()
public range ( mixed $start, mixed $end )
$start mixed
$end mixed

rename() public method

Rename the current field.
See also: Builder::rename()
See also: http://docs.mongodb.org/manual/reference/operator/rename/
public rename ( string $name )
$name string

set() public method

This is only relevant for insert, update, or findAndUpdate queries. For update and findAndUpdate queries, the $atomic parameter will determine whether or not a $set operator is used.
See also: Builder::set()
See also: http://docs.mongodb.org/manual/reference/operator/set/
public set ( mixed $value, boolean $atomic = true )
$value mixed
$atomic boolean

setNewObj() public method

Set the "new object".
See also: Builder::setNewObj()
public setNewObj ( array $newObj )
$newObj array

setOnInsert() public method

If an update operation with upsert: true results in an insert of a document, then $setOnInsert assigns the specified values to the fields in the document. If the update operation does not result in an insert, $setOnInsert does nothing.
See also: Builder::setOnInsert()
See also: https://docs.mongodb.org/manual/reference/operator/update/setOnInsert/
public setOnInsert ( mixed $value )
$value mixed

setQuery() public method

Set the query criteria.
See also: Builder::setQueryArray()
public setQuery ( array $query )
$query array

size() public method

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

slice() public method

This is useful in conjunction with {@link Expr::each()} for a {@link Expr::push()} operation. {@link Builder::selectSlice()} should be used for specifying $slice for a query projection.
See also: http://docs.mongodb.org/manual/reference/operator/slice/
public slice ( integer $slice )
$slice integer

sort() public method

If sorting by multiple fields, the first argument should be an array of field name (key) and order (value) pairs. This is useful in conjunction with {@link Expr::each()} for a {@link Expr::push()} operation. {@link Builder::sort()} should be used to sort the results of a query.
See also: http://docs.mongodb.org/manual/reference/operator/sort/
public sort ( array | string $fieldName, integer | string $order = null )
$fieldName array | string Field name or array of field/order pairs
$order integer | string Field order (if one field is specified)

text() public method

The $language option may be set with {@link Expr::language()}.
See also: Builder::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: Builder::type()
See also: http://docs.mongodb.org/manual/reference/operator/type/
public type ( integer $type )
$type integer

unsetField() public method

The field will be removed from the document (not set to null).
See also: Builder::unsetField()
See also: http://docs.mongodb.org/manual/reference/operator/unset/
public unsetField ( )

where() public method

Specify a JavaScript expression to use for matching documents.
See also: Builder::where()
See also: http://docs.mongodb.org/manual/reference/operator/where/
public where ( string | MongoCode $javascript )
$javascript string | MongoCode

withinBox() public method

Add $within criteria with a $box shape to the expression.
See also: Expr::geoWithinBox()
See also: http://docs.mongodb.org/manual/reference/operator/box/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinBox ( float $x1, float $y1, float $x2, float $y2 )
$x1 float
$y1 float
$x2 float
$y2 float

withinCenter() public method

Add $within criteria with a $center shape to the expression.
See also: Expr::geoWithinCenter()
See also: http://docs.mongodb.org/manual/reference/operator/center/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinCenter ( float $x, float $y, float $radius )
$x float
$y float
$radius float

withinCenterSphere() public method

Add $within criteria with a $centerSphere shape to the expression.
See also: Expr::geoWithinCenterSphere()
See also: http://docs.mongodb.org/manual/reference/operator/centerSphere/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinCenterSphere ( float $x, float $y, float $radius )
$x float
$y float
$radius float

withinPolygon() 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.
See also: Expr::geoWithinPolygon()
See also: http://docs.mongodb.org/manual/reference/operator/polygon/
Deprecation: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinPolygon ( )

Property Details

$currentField protected_oe property

The current field we are operating on.
protected string $currentField
return string

$newObj protected_oe property

The "new object" array containing either a full document or a number of atomic update operators.
protected array $newObj
return array

$query protected_oe property

The query criteria array.
protected string $query
return string