PHP 클래스 Sokil\Mongo\Expression

상속: implements Sokil\Mongo\ArrayableInterface
파일 보기 프로젝트 열기: sokil/php-mongo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_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