PHP Класс Sokil\Mongo\Expression

Наследование: implements Sokil\Mongo\ArrayableInterface
Показать файл Открыть проект Примеры использования класса

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

Свойство Тип Описание
$_expression

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

Метод Описание
convertToArray ( mixed $mixed ) : array Transform expression in different formats to canonical array form
expression ( ) : Expression Create new instance of expression
intersects ( string $field, GeoJson\Geometry\Geometry $geometry ) : Expression Selects documents whose geospatial data intersects with a specified GeoJSON object; i.e. where the intersection of the data and the specified object is non-empty. This includes cases where the data and the specified object share an edge. Uses spherical geometry.
merge ( Expression $expression )
nearPoint ( string $field, float $longitude, float $latitude, integer | array $distance ) : Expression Find document near points in flat surface
nearPointSpherical ( string $field, float $longitude, float $latitude, integer | array $distance ) : Expression Find document near points in spherical surface
toArray ( )
where ( $field, $value ) : Cursor | Expression Return a expression
whereAll ( string $field, array $values ) : Expression Find documents where the value of a field is an array that contains all the specified elements.
whereAnd ( array | Expression $expressions = null ) : Expression Select the documents that satisfy all the expressions in the array
whereAny ( string $field, array $values ) : Expression Find documents where the value of a field is an array that contains any of the specified elements.
whereArray ( $field )
whereArrayOfArrays ( $field )
whereArraySize ( string $field, integer $length ) : Expression Selects documents if the array field is a specified size.
whereBoolean ( $field )
whereDate ( $field )
whereDouble ( $field )
whereElemMatch ( string $field, Expression | callable | array $expression ) : Expression Matches documents in a collection that contain an array field with at least one element that matches all the specified query criteria.
whereElemNotMatch ( type $field, Expression | callable | array $expression ) : Expression Matches documents in a collection that contain an array field with elements that do not matches all the specified query criteria.
whereEmpty ( $field )
whereExists ( $field )
whereGreater ( $field, $value )
whereGreaterOrEqual ( $field, $value )
whereHasType ( $field, $type )
whereIn ( string $field, array $values ) : Expression Selects the documents where the value of a field equals any value in the specified array.
whereJsCondition ( $condition )
whereLess ( $field, $value )
whereLessOrEqual ( $field, $value )
whereLike ( $field, $regex, $caseInsensitive = true )
whereMod ( string $field, integer $divisor, integer $remainder ) Select documents where the value of a field divided by a divisor has the specified remainder (i.e. perform a modulo operation to select documents)
whereNoneOf ( string $field, array $values ) : Expression Find documents where the value of a field is an array that contains none of the specified elements.
whereNor ( array | Expression $expressions = null ) : Expression Selects the documents that fail all the query expressions in the array
whereNot ( Expression $expression )
whereNotEmpty ( $field )
whereNotEqual ( $field, $value )
whereNotExists ( $field )
whereNotIn ( $field, array $values )
whereNull ( $field )
whereObject ( $field )
whereObjectId ( $field )
whereOr ( array | Expression $expressions = null ) : Expression Selects the documents that satisfy at least one of the expressions
whereString ( $field )
whereText ( $search, $language = null, boolean | false $caseSensitive = null, boolean | false $diacriticSensitive = null ) Perform fulltext search
within ( string $field, GeoJson\Geometry\Geometry $geometry ) : Expression Selects documents with geospatial data that exists entirely within a specified shape.
withinBox ( string $field, array $bottomLeftCoordinate, array $upperRightCoordinate ) : Expression Return documents that are within the bounds of the rectangle, according to their point-based location data.
withinCircle ( string $field, float $longitude, float $latitude, float $radius ) : Expression Select documents with geospatial data within circle defined by center point and radius in flat surface
withinCircleSpherical ( string $field, float $longitude, float $latitude, float $radiusInRadians ) : Expression Select documents with geospatial data within circle defined by center point and radius in spherical surface
withinPolygon ( string $field, array $points ) : Expression Return documents that are within the polygon, according to their point-based location data.

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

convertToArray() публичный статический Метод

Transform expression in different formats to canonical array form
public static convertToArray ( mixed $mixed ) : array
$mixed mixed
Результат array

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

Create new instance of expression
public expression ( ) : Expression
Результат Expression

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

Selects documents whose geospatial data intersects with a specified GeoJSON object; i.e. where the intersection of the data and the specified object is non-empty. This includes cases where the data and the specified object share an edge. Uses spherical geometry.
public intersects ( string $field, GeoJson\Geometry\Geometry $geometry ) : Expression
$field string
$geometry GeoJson\Geometry\Geometry
Результат Expression

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

public merge ( Expression $expression )
$expression Expression

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

Find document near points in flat surface
public nearPoint ( string $field, float $longitude, float $latitude, integer | array $distance ) : Expression
$field string
$longitude float
$latitude float
$distance integer | array distance from point in meters. Array distance allowed only in MongoDB 2.6
Результат Expression

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

Find document near points in spherical surface
public nearPointSpherical ( string $field, float $longitude, float $latitude, integer | array $distance ) : Expression
$field string
$longitude float
$latitude float
$distance integer | array distance from point in meters. Array distance allowed only in MongoDB 2.6
Результат Expression

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

public toArray ( )

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

Return a expression
public where ( $field, $value ) : Cursor | Expression
Результат Cursor | Expression

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

This is equivalent of logical AND.
public whereAll ( string $field, array $values ) : Expression
$field string point-delimited field name
$values array
Результат Expression

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

Select the documents that satisfy all the expressions in the array
public whereAnd ( array | Expression $expressions = null ) : Expression
$expressions array | Expression Array of Expression instances or comma delimited expression list
Результат Expression

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

This is equivalent of logical AND.
public whereAny ( string $field, array $values ) : Expression
$field string point-delimited field name
$values array
Результат Expression

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

public whereArray ( $field )

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

public whereArrayOfArrays ( $field )

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

Selects documents if the array field is a specified size.
public whereArraySize ( string $field, integer $length ) : Expression
$field string
$length integer
Результат Expression

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

public whereBoolean ( $field )

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

public whereDate ( $field )

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

public whereDouble ( $field )

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

Matches documents in a collection that contain an array field with at least one element that matches all the specified query criteria.
public whereElemMatch ( string $field, Expression | callable | array $expression ) : Expression
$field string point-delimited field name
$expression Expression | callable | array
Результат Expression

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

Matches documents in a collection that contain an array field with elements that do not matches all the specified query criteria.
public whereElemNotMatch ( type $field, Expression | callable | array $expression ) : Expression
$field type
$expression Expression | callable | array
Результат Expression

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

public whereEmpty ( $field )

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

public whereExists ( $field )

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

public whereGreater ( $field, $value )

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

public whereGreaterOrEqual ( $field, $value )

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

public whereHasType ( $field, $type )

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

Selects the documents where the value of a field equals any value in the specified array.
public whereIn ( string $field, array $values ) : Expression
$field string
$values array
Результат Expression

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

public whereJsCondition ( $condition )

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

public whereLess ( $field, $value )

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

public whereLessOrEqual ( $field, $value )

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

public whereLike ( $field, $regex, $caseInsensitive = true )

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

Select documents where the value of a field divided by a divisor has the specified remainder (i.e. perform a modulo operation to select documents)
public whereMod ( string $field, integer $divisor, integer $remainder )
$field string
$divisor integer
$remainder integer

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

This is equivalent of logical AND.
public whereNoneOf ( string $field, array $values ) : Expression
$field string point-delimited field name
$values array
Результат Expression

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

Selects the documents that fail all the query expressions in the array
public whereNor ( array | Expression $expressions = null ) : Expression
$expressions array | Expression Array of Expression instances or comma delimited expression list
Результат Expression

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

public whereNot ( Expression $expression )
$expression Expression

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

public whereNotEmpty ( $field )

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

public whereNotEqual ( $field, $value )

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

public whereNotExists ( $field )

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

public whereNotIn ( $field, array $values )
$values array

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

public whereNull ( $field )

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

public whereObject ( $field )

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

public whereObjectId ( $field )

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

Selects the documents that satisfy at least one of the expressions
public whereOr ( array | Expression $expressions = null ) : Expression
$expressions array | Expression Array of Expression instances or comma delimited expression list
Результат Expression

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

public whereString ( $field )

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

Perform fulltext search
public whereText ( $search, $language = null, boolean | false $caseSensitive = null, boolean | false $diacriticSensitive = null )
$search A string of terms that MongoDB parses and uses to query the text index. MongoDB performs a logical OR search of the terms unless specified as a phrase.
$language Optional. The language that determines the list of stop words for the search and the rules for the stemmer and tokenizer. If not specified, the search uses the default language of the index. If you specify a language value of "none", then the text search uses simple tokenization with no list of stop words and no stemming.
$caseSensitive boolean | false Allowed from v.3.2 A boolean flag to enable or disable case sensitive search. Defaults to false; i.e. the search defers to the case insensitivity of the text index.
$diacriticSensitive boolean | false Allowed from v.3.2 A boolean flag to enable or disable diacritic sensitive search against version 3 text indexes. Defaults to false; i.e. the search defers to the diacritic insensitivity of the text index. Text searches against earlier versions of the text index are inherently diacritic sensitive and cannot be diacritic insensitive. As such, the $diacriticSensitive option has no effect with earlier versions of the text index.

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

Selects documents with geospatial data that exists entirely within a specified shape.
public within ( string $field, GeoJson\Geometry\Geometry $geometry ) : Expression
$field string
$geometry GeoJson\Geometry\Geometry
Результат Expression

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

Based on grid coordinates and does not query for GeoJSON shapes. Use planar geometry, so 2d index may be used but not required
public withinBox ( string $field, array $bottomLeftCoordinate, array $upperRightCoordinate ) : Expression
$field string
$bottomLeftCoordinate array Bottom left coordinate of box
$upperRightCoordinate array Upper right coordinate of box
Результат Expression

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

Select documents with geospatial data within circle defined by center point and radius in flat surface
public withinCircle ( string $field, float $longitude, float $latitude, float $radius ) : Expression
$field string
$longitude float
$latitude float
$radius float
Результат Expression

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

To calculate distance in radians
См. также: http://docs.mongodb.org/manual/tutorial/calculate-distances-using-spherical-geometry-with-2d-geospatial-indexes/
public withinCircleSpherical ( string $field, float $longitude, float $latitude, float $radiusInRadians ) : Expression
$field string
$longitude float
$latitude float
$radiusInRadians float in radians.
Результат Expression

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

Based on grid coordinates and does not query for GeoJSON shapes. Use planar geometry, so 2d index may be used but not required
public withinPolygon ( string $field, array $points ) : Expression
$field string
$points array array of coordinates
Результат Expression

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

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

protected $_expression