PHP Класс Doctrine\MongoDB\Query\Builder

С версии: 1.0
Автор: Jonathan H. Wage ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$collection Doctrine\MongoDB\Collection The Collection instance.
$expr Expr This object includes the query criteria and the "new object" used for insert and update queries.
$query array Array containing the query data.

Открытые методы

Метод Описание
__clone ( )
__construct ( Doctrine\MongoDB\Collection $collection ) Create a new query builder.
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.
count ( ) Change the query type to count.
currentDate ( string $type = 'date' ) Sets the value of the current field to the current date, either as a date or a timestamp.
debug ( string $name = null ) : mixed Return an array of information about the Builder state for debugging.
diacriticSensitive ( boolean $diacriticSensitive ) A boolean flag to enable or disable diacritic sensitive search for $text criteria.
distanceMultiplier ( float $distanceMultiplier ) Set the "distanceMultiplier" option for a geoNear command query.
distinct ( string $field ) Change the query type to a distinct command.
eagerCursor ( boolean $bool = true ) Set whether the query should return its result as an EagerCursor.
elemMatch ( array | Expr $expression ) Specify $elemMatch criteria for the current field.
equals ( mixed $value ) Specify an equality match for the current field.
exclude ( $fieldName = null ) Set one or more fields to be excluded from the query projection.
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.
finalize ( string | MongoCode $finalize ) Set the "finalize" option for a mapReduce or group command.
find ( ) Change the query type to find.
findAndRemove ( ) Change the query type to findAndRemove (uses the findAndModify command).
findAndUpdate ( ) Change the query type to findAndUpdate (uses the findAndModify command).
geoIntersects ( array | GeoJson\Geometry\Geometry $geometry ) Add $geoIntersects criteria with a GeoJSON geometry to the query.
geoNear ( float | array | GeoJson\Geometry\Point $x, float $y = null ) Change the query type to a geoNear command.
geoWithin ( array | 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.
getNewObj ( ) : array Return the expression's "new object".
getQuery ( array $options = [] ) : Query Create a new Query instance from the Builder state.
getQueryArray ( ) : array Return the expression's query criteria.
getType ( ) : integer Get the type of this query.
group ( mixed $keys, array $initial, string | MongoCode $reduce = null, array $options = [] ) Change the query type to a group command.
gt ( mixed $value ) Specify $gt criteria for the current field.
gte ( mixed $value ) Specify $gte criteria for the current field.
hint ( array | string $index ) Set the index hint for the query.
immortal ( boolean $bool = true ) Set the immortal cursor flag.
in ( array $values ) Specify $in criteria for the current field.
inc ( float | integer $value ) Increment the current field.
insert ( ) Change the query type to insert.
language ( string $language ) Set the $language option for $text criteria.
limit ( integer $limit ) Set the limit for the query.
lt ( mixed $value ) Specify $lt criteria for the current field.
lte ( mixed $value ) Specify $lte criteria for the current field.
map ( string | MongoCode $map ) Change the query type to a mapReduce command.
mapReduce ( string | MongoCode $map, string | MongoCode $reduce, array | string $out = ['inline' => true], array $options = [] ) Change the query type to a mapReduce command.
mapReduceOptions ( array $options ) Set additional options for a mapReduce command.
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 a geoNear command query or add $maxDistance criteria to the query.
maxTimeMS ( integer $ms ) Specifies a cumulative time limit in milliseconds for processing operations on a cursor.
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 a geoNear command query or add $minDistance criteria to the query.
mod ( float | integer $divisor, float | integer $remainder ) Specify $mod criteria for the current field.
mul ( float | integer $value ) Multiply the current field.
multiple ( boolean $bool = true ) Set the "multiple" option for an update query.
near ( float | array | GeoJson\Geometry\Point $x, float $y = null ) Add $near criteria to the query.
nearSphere ( float | array | GeoJson\Geometry\Point $x, float $y = null ) Add $nearSphere criteria to the query.
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.
out ( array | string $out ) Set the "out" option for a mapReduce command.
popFirst ( ) Remove the first element from the current array field.
popLast ( ) Remove the last element from the current array field.
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.
reduce ( string | MongoCode $reduce ) Set the "reduce" option for a mapReduce or group command.
remove ( ) Change the query type to remove.
rename ( string $name ) Rename the current field.
returnNew ( boolean $bool = true ) Set the "new" option for a findAndUpdate command.
select ( $fieldName = null ) Set one or more fields to be included in the query projection.
selectElemMatch ( string $fieldName, array | Expr $expression ) Select only matching embedded documents in an array field for the query projection.
selectMeta ( string $fieldName, string $metaDataKeyword ) Select a metadata field for the query projection.
selectSlice ( string $fieldName, integer $countOrSkip, integer $limit = null ) Select a slice of an array field for the query projection.
set ( mixed $value, boolean $atomic = true ) Set the current field to a value.
setNewObj ( array $newObj ) Set the expression's "new object".
setOnInsert ( mixed $value ) Set the current field to the value if the document is inserted in an upsert operation.
setQueryArray ( array $query ) Set the expression's query criteria.
setReadPreference ( $readPreference, array $tags = null ) Set the read preference for the query.
size ( integer $size ) Specify $size criteria for the current field.
skip ( integer $skip ) Set the skip for the query cursor.
slaveOkay ( boolean $bool = true ) Set whether the query may be directed to replica set secondaries.
snapshot ( boolean $bool = true ) Set the snapshot cursor flag.
sort ( array | string $fieldName, integer | string $order = 1 ) Set one or more field/order pairs on which to sort the query.
sortMeta ( string $fieldName, string $metaDataKeyword ) Specify a projected metadata field on which to sort the query.
spherical ( boolean $spherical = true ) Set the "spherical" option for a geoNear command query.
text ( string $search ) Specify $text criteria for the current field.
type ( integer $type ) Specify $type criteria for the current field.
unsetField ( ) Unset the current field.
update ( ) Change the query type to update.
updateMany ( ) Change the query type to update multiple documents
updateOne ( ) Change the query type to update a single document
upsert ( boolean $bool = true ) Set the "upsert" option for an update or findAndUpdate query.
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 query.
withinCenter ( float $x, float $y, float $radius ) Add $within criteria with a $center shape to the query.
withinCenterSphere ( float $x, float $y, float $radius ) Add $within criteria with a $centerSphere shape to the query.
withinPolygon ( ) Add $within criteria with a $polygon shape to the query.

Описание методов

__clone() публичный Метод

См. также: http://php.net/manual/en/language.oop5.cloning.php
public __clone ( )

__construct() публичный Метод

Create a new query builder.
public __construct ( Doctrine\MongoDB\Collection $collection )
$collection Doctrine\MongoDB\Collection

addAnd() публичный Метод

You can create a new expression using the {@link Builder::expr()} method.
См. также: Expr::addAnd()
См. также: http://docs.mongodb.org/manual/reference/operator/and/
public addAnd ( array | Expr $expression )
$expression array | Expr

addManyToSet() публичный Метод

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.
См. также: Expr::addManyToSet()
См. также: http://docs.mongodb.org/manual/reference/operator/addToSet/
См. также: http://docs.mongodb.org/manual/reference/operator/each/
Устаревший: 1.1 Use {@link Builder::addToSet()} with {@link Expr::each()}; Will be removed in 2.0
public addManyToSet ( array $values )
$values array

addNor() публичный Метод

You can create a new expression using the {@link Builder::expr()} method.
См. также: Expr::addNor()
См. также: http://docs.mongodb.org/manual/reference/operator/nor/
public addNor ( array | Expr $expression )
$expression array | Expr

addOr() публичный Метод

You can create a new expression using the {@link Builder::expr()} method.
См. также: Expr::addOr()
См. также: http://docs.mongodb.org/manual/reference/operator/or/
public addOr ( array | Expr $expression )
$expression array | Expr

addToSet() публичный Метод

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()}.
См. также: Expr::addToSet()
См. также: http://docs.mongodb.org/manual/reference/operator/addToSet/
См. также: http://docs.mongodb.org/manual/reference/operator/each/
public addToSet ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

all() публичный Метод

Specify $all criteria for the current field.
См. также: Expr::all()
См. также: http://docs.mongodb.org/manual/reference/operator/all/
public all ( array $values )
$values array

bitAnd() публичный Метод

Apply a bitwise and operation on the current field.
См. также: Expr::bitAnd()
См. также: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitAnd ( integer $value )
$value integer

bitOr() публичный Метод

Apply a bitwise or operation on the current field.
См. также: Expr::bitOr()
См. также: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitOr ( integer $value )
$value integer

bitXor() публичный Метод

Apply a bitwise xor operation on the current field.
См. также: Expr::bitXor()
См. также: http://docs.mongodb.org/manual/reference/operator/update/bit/
public bitXor ( integer $value )
$value integer

bitsAllClear() публичный Метод

Matches documents where all of the bit positions given by the query are clear.
См. также: Expr::bitsAllClear()
См. также: https://docs.mongodb.org/manual/reference/operator/query/bitsAllClear/
public bitsAllClear ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAllSet() публичный Метод

Matches documents where all of the bit positions given by the query are set.
См. также: Expr::bitsAllSet()
См. также: https://docs.mongodb.org/manual/reference/operator/query/bitsAllSet/
public bitsAllSet ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAnyClear() публичный Метод

Matches documents where any of the bit positions given by the query are clear.
См. также: Expr::bitsAnyClear()
См. также: https://docs.mongodb.org/manual/reference/operator/query/bitsAnyClear/
public bitsAnyClear ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

bitsAnySet() публичный Метод

Matches documents where any of the bit positions given by the query are set.
См. также: Expr::bitsAnySet()
См. также: https://docs.mongodb.org/manual/reference/operator/query/bitsAnySet/
public bitsAnySet ( integer | array | MongoBinData $value )
$value integer | array | MongoBinData

caseSensitive() публичный Метод

This method must be called after text().
См. также: Expr::caseSensitive()
См. также: http://docs.mongodb.org/manual/reference/operator/text/
С версии: 1.3
public caseSensitive ( boolean $caseSensitive )
$caseSensitive boolean

comment() публичный Метод

Associates a comment to any expression taking a query predicate.
См. также: Expr::comment()
См. также: http://docs.mongodb.org/manual/reference/operator/query/comment/
public comment ( string $comment )
$comment string

count() публичный Метод

Change the query type to count.
public count ( )

currentDate() публичный Метод

Sets the value of the current field to the current date, either as a date or a timestamp.
См. также: Expr::currentDate()
См. также: http://docs.mongodb.org/manual/reference/operator/currentDate/
public currentDate ( string $type = 'date' )
$type string

debug() публичный Метод

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
Результат mixed

diacriticSensitive() публичный Метод

This method must be called after text().
См. также: Builder::diacriticSensitive()
См. также: http://docs.mongodb.org/manual/reference/operator/text/
С версии: 1.3
public diacriticSensitive ( boolean $diacriticSensitive )
$diacriticSensitive boolean

distanceMultiplier() публичный Метод

Set the "distanceMultiplier" option for a geoNear command query.
public distanceMultiplier ( float $distanceMultiplier )
$distanceMultiplier float

distinct() публичный Метод

Change the query type to a distinct command.
См. также: http://docs.mongodb.org/manual/reference/command/distinct/
public distinct ( string $field )
$field string

eagerCursor() публичный Метод

Set whether the query should return its result as an EagerCursor.
public eagerCursor ( boolean $bool = true )
$bool boolean

elemMatch() публичный Метод

You can create a new expression using the {@link Builder::expr()} method.
См. также: Expr::elemMatch()
См. также: http://docs.mongodb.org/manual/reference/operator/elemMatch/
public elemMatch ( array | Expr $expression )
$expression array | Expr

equals() публичный Метод

Specify an equality match for the current field.
См. также: Expr::equals()
public equals ( mixed $value )
$value mixed

exclude() публичный Метод

If fields have been selected for inclusion, only the "_id" field may be excluded.
public exclude ( $fieldName = null )

exists() публичный Метод

Specify $exists criteria for the current field.
См. также: Expr::exists()
См. также: http://docs.mongodb.org/manual/reference/operator/exists/
public exists ( boolean $bool )
$bool boolean

expr() публичный Метод

Create a new Expr instance that can be used to build partial expressions for other operator methods.
public expr ( ) : Expr
Результат Expr $expr

field() публичный Метод

Set the current field for building the expression.
См. также: Expr::field()
public field ( string $field )
$field string

finalize() публичный Метод

Set the "finalize" option for a mapReduce or group command.
public finalize ( string | MongoCode $finalize )
$finalize string | MongoCode

find() публичный Метод

Change the query type to find.
public find ( )

findAndRemove() публичный Метод

Change the query type to findAndRemove (uses the findAndModify command).
См. также: http://docs.mongodb.org/manual/reference/command/findAndModify/
public findAndRemove ( )

findAndUpdate() публичный Метод

Change the query type to findAndUpdate (uses the findAndModify command).
См. также: http://docs.mongodb.org/manual/reference/command/findAndModify/
public findAndUpdate ( )

geoIntersects() публичный Метод

The geometry parameter GeoJSON object or an array corresponding to the geometry's JSON representation.
См. также: Expr::geoIntersects()
См. также: http://docs.mongodb.org/manual/reference/operator/geoIntersects/
public geoIntersects ( array | GeoJson\Geometry\Geometry $geometry )
$geometry array | GeoJson\Geometry\Geometry

geoNear() публичный Метод

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. If GeoJSON is used, the "spherical" option will default to true. This method sets the "near" option for the geoNear command. The "num" option may be set using {@link Expr::limit()}. The "distanceMultiplier", "maxDistance", "minDistance", and "spherical" options may be set using their respective builder methods. Additional query criteria will be assigned to the "query" option.
См. также: http://docs.mongodb.org/manual/reference/command/geoNear/
public geoNear ( float | array | GeoJson\Geometry\Point $x, float $y = null )
$x float | array | GeoJson\Geometry\Point
$y float

geoWithin() публичный Метод

The geometry parameter GeoJSON object or an array corresponding to the geometry's JSON representation.
См. также: Expr::geoWithin()
См. также: http://docs.mongodb.org/manual/reference/operator/geoWithin/
public geoWithin ( array | GeoJson\Geometry\Geometry $geometry )
$geometry array | GeoJson\Geometry\Geometry

geoWithinBox() публичный Метод

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.
См. также: Expr::geoWithinBox()
См. также: 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() публичный Метод

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

geoWithinCenterSphere() публичный Метод

Note: the $centerSphere operator supports both 2d and 2dsphere indexes.
См. также: Expr::geoWithinCenterSphere()
См. также: http://docs.mongodb.org/manual/reference/operator/centerSphere/
public geoWithinCenterSphere ( float $x, float $y, float $radius )
$x float
$y float
$radius float

geoWithinPolygon() публичный Метод

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.
См. также: Expr::geoWithinPolygon()
См. также: http://docs.mongodb.org/manual/reference/operator/polygon/
public geoWithinPolygon ( )

getNewObj() публичный Метод

Return the expression's "new object".
См. также: Expr::getNewObj()
public getNewObj ( ) : array
Результат array

getQuery() публичный Метод

Create a new Query instance from the Builder state.
public getQuery ( array $options = [] ) : Query
$options array
Результат Query

getQueryArray() публичный Метод

Return the expression's query criteria.
См. также: Expr::getQuery()
public getQueryArray ( ) : array
Результат array

getType() публичный Метод

Get the type of this query.
public getType ( ) : integer
Результат integer $type

group() публичный Метод

If the "reduce" option is not specified when calling this method, it must be set with the {@link Builder::reduce()} method.
См. также: http://docs.mongodb.org/manual/reference/command/group/
public group ( mixed $keys, array $initial, string | MongoCode $reduce = null, array $options = [] )
$keys mixed
$initial array
$reduce string | MongoCode
$options array

gt() публичный Метод

Specify $gt criteria for the current field.
См. также: Expr::gt()
См. также: http://docs.mongodb.org/manual/reference/operator/gt/
public gt ( mixed $value )
$value mixed

gte() публичный Метод

Specify $gte criteria for the current field.
См. также: Expr::gte()
См. также: http://docs.mongodb.org/manual/reference/operator/gte/
public gte ( mixed $value )
$value mixed

hint() публичный Метод

Set the index hint for the query.
public hint ( array | string $index )
$index array | string

immortal() публичный Метод

Set the immortal cursor flag.
public immortal ( boolean $bool = true )
$bool boolean

in() публичный Метод

Specify $in criteria for the current field.
См. также: Expr::in()
См. также: http://docs.mongodb.org/manual/reference/operator/in/
public in ( array $values )
$values array

inc() публичный Метод

If the field does not exist, it will be set to this value.
См. также: Expr::inc()
См. также: http://docs.mongodb.org/manual/reference/operator/inc/
public inc ( float | integer $value )
$value float | integer

insert() публичный Метод

Change the query type to insert.
public insert ( )

language() публичный Метод

This method must be called after text().
См. также: Expr::language()
См. также: http://docs.mongodb.org/manual/reference/operator/text/
public language ( string $language )
$language string

limit() публичный Метод

This is only relevant for find queries and geoNear and mapReduce commands.
См. также: Query::prepareCursor()
public limit ( integer $limit )
$limit integer

lt() публичный Метод

Specify $lt criteria for the current field.
См. также: Expr::lte()
См. также: http://docs.mongodb.org/manual/reference/operator/lte/
public lt ( mixed $value )
$value mixed

lte() публичный Метод

Specify $lte criteria for the current field.
См. также: Expr::lte()
См. также: http://docs.mongodb.org/manual/reference/operator/lte/
public lte ( mixed $value )
$value mixed

map() публичный Метод

The "reduce" option is not specified when calling this method; it must be set with the {@link Builder::reduce()} method. The "out" option defaults to inline, like {@link Builder::mapReduce()}.
См. также: http://docs.mongodb.org/manual/reference/command/mapReduce/
public map ( string | MongoCode $map )
$map string | MongoCode

mapReduce() публичный Метод

Change the query type to a mapReduce command.
См. также: http://docs.mongodb.org/manual/reference/command/mapReduce/
public mapReduce ( string | MongoCode $map, string | MongoCode $reduce, array | string $out = ['inline' => true], array $options = [] )
$map string | MongoCode
$reduce string | MongoCode
$out array | string
$options array

mapReduceOptions() публичный Метод

Set additional options for a mapReduce command.
public mapReduceOptions ( array $options )
$options array

max() публичный Метод

Updates the value of the field to a specified value if the specified value is greater than the current value of the field.
См. также: Expr::max()
См. также: http://docs.mongodb.org/manual/reference/operator/update/max/
public max ( mixed $value )
$value mixed

maxDistance() публичный Метод

If the query is a geoNear command ({@link Expr::geoNear()} was called), the "maxDistance" command option will be set; otherwise, $maxDistance will be added to the current expression. If the query uses GeoJSON points, $maxDistance will be interpreted in meters. If legacy point coordinates are used, $maxDistance will be interpreted in radians.
См. также: Expr::maxDistance()
См. также: http://docs.mongodb.org/manual/reference/command/geoNear/
См. также: http://docs.mongodb.org/manual/reference/operator/maxDistance/
См. также: http://docs.mongodb.org/manual/reference/operator/near/
См. также: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public maxDistance ( float $maxDistance )
$maxDistance float

maxTimeMS() публичный Метод

Specifies a cumulative time limit in milliseconds for processing operations on a cursor.
public maxTimeMS ( integer $ms )
$ms integer

min() публичный Метод

Updates the value of the field to a specified value if the specified value is less than the current value of the field.
См. также: Expr::min()
См. также: http://docs.mongodb.org/manual/reference/operator/update/min/
public min ( mixed $value )
$value mixed

minDistance() публичный Метод

If the query is a geoNear command ({@link Expr::geoNear()} was called), the "minDistance" command option will be set; otherwise, $minDistance will be added to the current expression. If the query uses GeoJSON points, $minDistance will be interpreted in meters. If legacy point coordinates are used, $minDistance will be interpreted in radians.
См. также: Expr::minDistance()
См. также: http://docs.mongodb.org/manual/reference/command/geoNear/
См. также: http://docs.mongodb.org/manual/reference/operator/minDistance/
См. также: http://docs.mongodb.org/manual/reference/operator/near/
См. также: http://docs.mongodb.org/manual/reference/operator/nearSphere/
public minDistance ( float $minDistance )
$minDistance float

mod() публичный Метод

Specify $mod criteria for the current field.
См. также: Expr::mod()
См. также: http://docs.mongodb.org/manual/reference/operator/mod/
public mod ( float | integer $divisor, float | integer $remainder )
$divisor float | integer
$remainder float | integer

mul() публичный Метод

If the field does not exist, it will be set to 0.
См. также: Expr::mul()
См. также: http://docs.mongodb.org/manual/reference/operator/mul/
public mul ( float | integer $value )
$value float | integer

multiple() публичный Метод

Set the "multiple" option for an update query.
Устаревший: Deprecated in version 1.4 - use updateOne or updateMany instead
public multiple ( boolean $bool = true )
$bool boolean

near() публичный Метод

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.
См. также: Expr::near()
См. также: 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() публичный Метод

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.
См. также: Expr::nearSphere()
См. также: 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() публичный Метод

You can create a new expression using the {@link Builder::expr()} method.
См. также: Expr::not()
См. также: http://docs.mongodb.org/manual/reference/operator/not/
public not ( array | Expr $expression )
$expression array | Expr

notEqual() публичный Метод

Specify $ne criteria for the current field.
См. также: Expr::notEqual()
См. также: http://docs.mongodb.org/manual/reference/operator/ne/
public notEqual ( mixed $value )
$value mixed

notIn() публичный Метод

Specify $nin criteria for the current field.
См. также: Expr::notIn()
См. также: http://docs.mongodb.org/manual/reference/operator/nin/
public notIn ( array $values )
$values array

out() публичный Метод

Set the "out" option for a mapReduce command.
public out ( array | string $out )
$out array | string

popFirst() публичный Метод

Remove the first element from the current array field.
См. также: Expr::popFirst()
См. также: http://docs.mongodb.org/manual/reference/operator/pop/
public popFirst ( )

popLast() публичный Метод

Remove the last element from the current array field.
См. также: Expr::popLast()
См. также: http://docs.mongodb.org/manual/reference/operator/pop/
public popLast ( )

pull() публичный Метод

Remove all elements matching the given value or expression from the current array field.
См. также: Expr::pull()
См. также: http://docs.mongodb.org/manual/reference/operator/pull/
public pull ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

pullAll() публичный Метод

Remove all elements matching any of the given values from the current array field.
См. также: Expr::pullAll()
См. также: http://docs.mongodb.org/manual/reference/operator/pullAll/
public pullAll ( array $values )
$values array

push() публичный Метод

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.
См. также: Expr::push()
См. также: http://docs.mongodb.org/manual/reference/operator/push/
См. также: http://docs.mongodb.org/manual/reference/operator/each/
См. также: http://docs.mongodb.org/manual/reference/operator/slice/
См. также: http://docs.mongodb.org/manual/reference/operator/sort/
public push ( mixed | Expr $valueOrExpression )
$valueOrExpression mixed | Expr

pushAll() публичный Метод

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 Builder::push()} and {@link Expr::each()} should be used in its place.
См. также: Expr::pushAll()
См. также: http://docs.mongodb.org/manual/reference/operator/pushAll/
public pushAll ( array $values )
$values array

range() публичный Метод

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.
См. также: Expr::range()
public range ( mixed $start, mixed $end )
$start mixed
$end mixed

reduce() публичный Метод

Set the "reduce" option for a mapReduce or group command.
public reduce ( string | MongoCode $reduce )
$reduce string | MongoCode

remove() публичный Метод

Change the query type to remove.
public remove ( )

rename() публичный Метод

Rename the current field.
См. также: Expr::rename()
См. также: http://docs.mongodb.org/manual/reference/operator/rename/
public rename ( string $name )
$name string

returnNew() публичный Метод

Set the "new" option for a findAndUpdate command.
public returnNew ( boolean $bool = true )
$bool boolean

select() публичный Метод

Set one or more fields to be included in the query projection.
public select ( $fieldName = null )

selectElemMatch() публичный Метод

Select only matching embedded documents in an array field for the query projection.
См. также: http://docs.mongodb.org/manual/reference/projection/elemMatch/
public selectElemMatch ( string $fieldName, array | Expr $expression )
$fieldName string
$expression array | Expr

selectMeta() публичный Метод

Select a metadata field for the query projection.
См. также: http://docs.mongodb.org/master/reference/operator/projection/meta/
public selectMeta ( string $fieldName, string $metaDataKeyword )
$fieldName string
$metaDataKeyword string

selectSlice() публичный Метод

The $countOrSkip parameter has two very different meanings, depending on whether or not $limit is provided. See the MongoDB documentation for more information.
См. также: http://docs.mongodb.org/manual/reference/projection/slice/
public selectSlice ( string $fieldName, integer $countOrSkip, integer $limit = null )
$fieldName string
$countOrSkip integer Count parameter, or skip if limit is specified
$limit integer Limit parameter used in conjunction with skip

set() публичный Метод

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.
См. также: Expr::set()
См. также: http://docs.mongodb.org/manual/reference/operator/set/
public set ( mixed $value, boolean $atomic = true )
$value mixed
$atomic boolean

setNewObj() публичный Метод

Set the expression's "new object".
См. также: Expr::setNewObj()
public setNewObj ( array $newObj )
$newObj array

setOnInsert() публичный Метод

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.
См. также: Expr::setOnInsert()
См. также: https://docs.mongodb.org/manual/reference/operator/update/setOnInsert/
public setOnInsert ( mixed $value )
$value mixed

setQueryArray() публичный Метод

Set the expression's query criteria.
См. также: Expr::setQuery()
public setQueryArray ( array $query )
$query array

setReadPreference() публичный Метод

This is only relevant for read-only queries and commands.
См. также: http://docs.mongodb.org/manual/core/read-preference/
public setReadPreference ( $readPreference, array $tags = null )
$tags array

size() публичный Метод

Specify $size criteria for the current field.
См. также: Expr::size()
См. также: http://docs.mongodb.org/manual/reference/operator/size/
public size ( integer $size )
$size integer

skip() публичный Метод

This is only relevant for find queries, or mapReduce queries that store results in an output collecton and return a cursor.
См. также: Query::prepareCursor()
public skip ( integer $skip )
$skip integer

slaveOkay() публичный Метод

If the driver supports read preferences and slaveOkay is true, a "secondaryPreferred" read preference will be used. Otherwise, a "primary" read preference will be used.
См. также: Doctrine\MongoDB\Cursor::setMongoCursorSlaveOkay()
public slaveOkay ( boolean $bool = true )
$bool boolean

snapshot() публичный Метод

Set the snapshot cursor flag.
public snapshot ( boolean $bool = true )
$bool boolean

sort() публичный Метод

If sorting by multiple fields, the first argument should be an array of field name (key) and order (value) pairs.
public sort ( array | string $fieldName, integer | string $order = 1 )
$fieldName array | string Field name or array of field/order pairs
$order integer | string Field order (if one field is specified)

sortMeta() публичный Метод

Sort order is not configurable for metadata fields. Sorting by a metadata field requires the same field and $meta expression to exist in the projection document. This method will call {@link Builder::selectMeta()} if the field is not already set in the projection.
См. также: http://docs.mongodb.org/master/reference/operator/projection/meta/#sort
public sortMeta ( string $fieldName, string $metaDataKeyword )
$fieldName string Field name of the projected metadata
$metaDataKeyword string

spherical() публичный Метод

Set the "spherical" option for a geoNear command query.
public spherical ( boolean $spherical = true )
$spherical boolean

text() публичный Метод

The $language option may be set with {@link Builder::language()}.
См. также: Expr::text()
См. также: http://docs.mongodb.org/master/reference/operator/query/text/
public text ( string $search )
$search string

type() публичный Метод

Specify $type criteria for the current field.
См. также: Expr::type()
См. также: http://docs.mongodb.org/manual/reference/operator/type/
public type ( integer $type )
$type integer

unsetField() публичный Метод

The field will be removed from the document (not set to null).
См. также: Expr::unsetField()
См. также: http://docs.mongodb.org/manual/reference/operator/unset/
public unsetField ( )

update() публичный Метод

Change the query type to update.
Устаревший: Deprecated in version 1.4 - use updateOne or updateMany instead
public update ( )

updateMany() публичный Метод

Change the query type to update multiple documents
public updateMany ( )

updateOne() публичный Метод

Change the query type to update a single document
public updateOne ( )

upsert() публичный Метод

Set the "upsert" option for an update or findAndUpdate query.
public upsert ( boolean $bool = true )
$bool boolean

where() публичный Метод

Specify a JavaScript expression to use for matching documents.
См. также: Expr::where()
См. также: http://docs.mongodb.org/manual/reference/operator/where/
public where ( string | MongoCode $javascript )
$javascript string | MongoCode

withinBox() публичный Метод

Add $within criteria with a $box shape to the query.
См. также: Builder::geoWithinBox()
См. также: Expr::withinBox()
См. также: http://docs.mongodb.org/manual/reference/operator/box/
Устаревший: 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() публичный Метод

Add $within criteria with a $center shape to the query.
См. также: Builder::geoWithinCenter()
См. также: Expr::withinCenter()
См. также: http://docs.mongodb.org/manual/reference/operator/center/
Устаревший: 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() публичный Метод

Add $within criteria with a $centerSphere shape to the query.
См. также: Builder::geoWithinCenterSphere()
См. также: Expr::withinCenterSphere()
См. также: http://docs.mongodb.org/manual/reference/operator/centerSphere/
Устаревший: 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() публичный Метод

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.
См. также: Builder::geoWithinPolygon()
См. также: Expr::withinPolygon()
См. также: http://docs.mongodb.org/manual/reference/operator/polygon/
Устаревший: 1.1 MongoDB 2.4 deprecated $within in favor of $geoWithin
public withinPolygon ( )

Описание свойств

$collection защищенное свойство

The Collection instance.
protected Collection,Doctrine\MongoDB $collection
Результат Doctrine\MongoDB\Collection

$expr защищенное свойство

This object includes the query criteria and the "new object" used for insert and update queries.
protected Expr,Doctrine\MongoDB\Query $expr
Результат Expr

$query защищенное свойство

Array containing the query data.
protected array $query
Результат array