PHP Class Doctrine\MongoDB\Aggregation\Expr

Since: 1.2
Author: alcaeus ([email protected])
Show file Open project: doctrine/mongodb Class Usage Examples

Public Methods

Method Description
abs ( mixed | self $number ) Returns the absolute value of a number.
add ( mixed | self $expression1, mixed | self $expression2 ) Adds numbers together or adds numbers and a date. If one of the arguments is a date, $add treats the other arguments as milliseconds to add to the date.
addAnd ( array | self $expression ) Adds one or more $and clauses to the current expression.
addOr ( array | self $expression ) Adds one or more $or clause to the current expression.
addToSet ( mixed | self $expression ) Returns an array of all unique values that results from applying an expression to each document in a group of documents that share the same group by key. Order of the elements in the output array is unspecified.
allElementsTrue ( mixed | self $expression ) Evaluates an array as a set and returns true if no element in the array is false. Otherwise, returns false. An empty array returns true.
anyElementTrue ( array | self $expression ) Evaluates an array as a set and returns true if any of the elements are true and false otherwise. An empty array returns false.
arrayElemAt ( mixed | self $array, mixed | self $index ) Returns the element at the specified array index.
avg ( mixed | self $expression ) Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
ceil ( mixed | self $number ) Returns the smallest integer greater than or equal to the specified number.
cmp ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: -1 if the first value is less than the second.
concat ( mixed | self $expression1, mixed | self $expression2 ) Concatenates strings and returns the concatenated string.
concatArrays ( mixed | self $array1, mixed | self $array2 ) Concatenates arrays to return the concatenated array.
cond ( mixed | self $if, mixed | self $then, mixed | self $else ) Evaluates a boolean expression to return one of the two specified return expressions.
dateToString ( string $format, mixed | self $expression ) Converts a date object to a string according to a user-specified format.
dayOfMonth ( mixed | self $expression ) Returns the day of the month for a date as a number between 1 and 31.
dayOfWeek ( mixed | self $expression ) Returns the day of the week for a date as a number between 1 (Sunday) and 7 (Saturday).
dayOfYear ( mixed | self $expression ) Returns the day of the year for a date as a number between 1 and 366.
divide ( mixed | self $expression1, mixed | self $expression2 ) Divides one number by another and returns the result. The first argument is divided by the second argument.
eq ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns whether the are equivalent.
exp ( mixed | self $exponent ) Raises Euler’s number to the specified exponent and returns the result.
expr ( ) : static Returns a new expression object
expression ( mixed | self $value ) Allows any expression to be used as a field value.
field ( string $fieldName ) Set the current field for building the expression.
filter ( mixed | self $input, mixed | self $as, mixed | self $cond ) Selects a subset of the array to return based on the specified condition.
first ( mixed | self $expression ) Returns the value that results from applying an expression to the first document in a group of documents that share the same group by key. Only meaningful when documents are in a defined order.
floor ( mixed | self $number ) Returns the largest integer less than or equal to the specified number.
getExpression ( ) : array
gt ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: true when the first value is greater than the second value.
gte ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: true when the first value is greater than or equivalent to the second value.
hour ( mixed | self $expression ) Returns the hour portion of a date as a number between 0 and 23.
ifNull ( mixed | self $expression, mixed | self $replacementExpression ) Evaluates an expression and returns the value of the expression if the expression evaluates to a non-null value. If the expression evaluates to a null value, including instances of undefined values or missing fields, returns the value of the replacement expression.
isArray ( mixed | self $expression ) Determines if the operand is an array. Returns a boolean.
last ( mixed | self $expression ) Returns the value that results from applying an expression to the last document in a group of documents that share the same group by a field.
let ( mixed | self $vars, mixed | self $in ) Binds variables for use in the specified expression, and returns the result of the expression.
literal ( mixed | self $value ) Returns a value without parsing. Use for values that the aggregation pipeline may interpret as an expression.
ln ( mixed | self $number ) Calculates the natural logarithm ln (i.e loge) of a number and returns the result as a double.
log ( mixed | self $number, mixed | self $base ) Calculates the log of a number in the specified base and returns the result as a double.
log10 ( mixed | self $number ) Calculates the log base 10 of a number and returns the result as a double.
lt ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: true when the first value is less than the second value.
lte ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: true when the first value is less than or equivalent to the second value.
map ( mixed | self $input, string $as, mixed | self $in ) Applies an expression to each item in an array and returns an array with the applied results.
max ( mixed | self $expression ) Returns the highest value that results from applying an expression to each document in a group of documents that share the same group by key.
meta ( $metaDataKeyword ) Returns the metadata associated with a document in a pipeline operations.
millisecond ( mixed | self $expression ) Returns the millisecond portion of a date as an integer between 0 and 999.
min ( mixed | self $expression ) Returns the lowest value that results from applying an expression to each document in a group of documents that share the same group by key.
minute ( mixed | self $expression ) Returns the minute portion of a date as a number between 0 and 59.
mod ( mixed | self $expression1, mixed | self $expression2 ) Divides one number by another and returns the remainder. The first argument is divided by the second argument.
month ( mixed | self $expression ) Returns the month of a date as a number between 1 and 12.
multiply ( mixed | self $expression1, mixed | self $expression2 ) Multiplies numbers together and returns the result.
ne ( mixed | self $expression1, mixed | self $expression2 ) Compares two values and returns: true when the values are not equivalent.
not ( mixed | self $expression ) Evaluates a boolean and returns the opposite boolean value.
pow ( mixed | self $number, mixed | self $exponent ) Raises a number to the specified exponent and returns the result.
push ( mixed | self $expression ) Returns an array of all values that result from applying an expression to each document in a group of documents that share the same group by key.
second ( mixed | self $expression ) Returns the second portion of a date as a number between 0 and 59, but can be 60 to account for leap seconds.
setDifference ( mixed | self $expression1, mixed | self $expression2 ) Takes two sets and returns an array containing the elements that only exist in the first set.
setEquals ( mixed | self $expression1, mixed | self $expression2 ) Compares two or more arrays and returns true if they have the same distinct elements and false otherwise.
setIntersection ( mixed | self $expression1, mixed | self $expression2 ) Takes two or more arrays and returns an array that contains the elements that appear in every input array.
setIsSubset ( mixed | self $expression1, mixed | self $expression2 ) Takes two arrays and returns true when the first array is a subset of the second, including when the first array equals the second array, and false otherwise.
setUnion ( mixed | self $expression1, mixed | self $expression2 ) Takes two or more arrays and returns an array containing the elements that appear in any input array.
size ( mixed | self $expression ) Counts and returns the total the number of items in an array.
slice ( mixed | self $array, mixed | self $n, mixed | self | null $position = null ) Returns a subset of an array.
sqrt ( mixed | self $expression ) Calculates the square root of a positive number and returns the result as a double.
stdDevPop ( mixed | self $expression1 ) Calculates the population standard deviation of the input values.
stdDevSamp ( mixed | self $expression1 ) Calculates the sample standard deviation of the input values.
strcasecmp ( mixed | self $expression1, mixed | self $expression2 ) Performs case-insensitive comparison of two strings. Returns 1 if first string is “greater than” the second string.
substr ( mixed | self $string, mixed | self $start, mixed | self $length ) Returns a substring of a string, starting at a specified index position and including the specified number of characters. The index is zero-based.
subtract ( mixed | self $expression1, mixed | self $expression2 ) Subtracts two numbers to return the difference. The second argument is subtracted from the first argument.
sum ( mixed | self $expression ) Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
toLower ( mixed | self $expression ) Converts a string to lowercase, returning the result.
toUpper ( mixed | self $expression ) Converts a string to uppercase, returning the result.
trunc ( mixed | self $number ) Truncates a number to its integer.
week ( mixed | self $expression ) Returns the week of the year for a date as a number between 0 and 53.
year ( mixed | self $expression ) Returns the year portion of a date.

Protected Methods

Method Description
ensureArray ( mixed | self $expression ) : mixed Ensures an array or operator expression is converted to an array.

Private Methods

Method Description
operator ( string $operator, array | self[] | self $expression ) Defines an operator and value on the expression.
requiresCurrentField ( string $method = null ) Ensure that a current field has been set.

Method Details

abs() public method

The argument can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/abs/
Since: 1.3
public abs ( mixed | self $number )
$number mixed | self

add() public method

The arguments can be any valid expression as long as they resolve to either all numbers or to numbers and a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/add/
public add ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

addAnd() public method

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

addOr() public method

Adds one or more $or clause to the current expression.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/or/
public addOr ( array | self $expression )
$expression array | self

addToSet() public method

AddToSet is an accumulator operation only available in the group stage.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/addToSet/
public addToSet ( mixed | self $expression )
$expression mixed | self

allElementsTrue() public method

The expression must resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/allElementsTrue/
public allElementsTrue ( mixed | self $expression )
$expression mixed | self

anyElementTrue() public method

The expression must resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/anyElementTrue/
public anyElementTrue ( array | self $expression )
$expression array | self

arrayElemAt() public method

The expression can be any valid expression as long as it resolves to an array. The expression can be any valid expression as long as it resolves to an integer.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/arrayElemAt/
Since: 1.3
public arrayElemAt ( mixed | self $array, mixed | self $index )
$array mixed | self
$index mixed | self

avg() public method

Returns the average value of the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/avg/
public avg ( mixed | self $expression )
$expression mixed | self

ceil() public method

The expression can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/ceil/
Since: 1.3
public ceil ( mixed | self $number )
$number mixed | self

cmp() public method

1 if the first value is greater than the second. 0 if the two values are equivalent.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/cmp/
public cmp ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

concat() public method

The arguments can be any valid expression as long as they resolve to strings. If the argument resolves to a value of null or refers to a field that is missing, $concat returns null.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/concat/
public concat ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

concatArrays() public method

The expressions can be any valid expression as long as they resolve to an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/concatArrays/
Since: 1.3
public concatArrays ( mixed | self $array1, mixed | self $array2 )
$array1 mixed | self
$array2 mixed | self

cond() public method

The arguments can be any valid expression.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/cond/
public cond ( mixed | self $if, mixed | self $then, mixed | self $else )
$if mixed | self
$then mixed | self
$else mixed | self

dateToString() public method

The format string can be any string literal, containing 0 or more format specifiers. The date argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/dateToString/
public dateToString ( string $format, mixed | self $expression )
$format string
$expression mixed | self

dayOfMonth() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/dayOfMonth/
public dayOfMonth ( mixed | self $expression )
$expression mixed | self

dayOfWeek() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/dayOfWeek/
public dayOfWeek ( mixed | self $expression )
$expression mixed | self

dayOfYear() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/dayOfYear/
public dayOfYear ( mixed | self $expression )
$expression mixed | self

divide() public method

The arguments can be any valid expression as long as the resolve to numbers.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/divide/
public divide ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

ensureArray() protected method

Ensures an array or operator expression is converted to an array.
protected ensureArray ( mixed | self $expression ) : mixed
$expression mixed | self
return mixed

eq() public method

Compares two values and returns whether the are equivalent.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/eq/
public eq ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

exp() public method

The expression can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/exp/
Since: 1.3
public exp ( mixed | self $exponent )
$exponent mixed | self

expr() public method

Returns a new expression object
Since: 1.3
public expr ( ) : static
return static

expression() public method

Allows any expression to be used as a field value.
See also: http://docs.mongodb.org/manual/meta/aggregation-quick-reference/#aggregation-expressions
public expression ( mixed | self $value )
$value mixed | self

field() public method

Set the current field for building the expression.
public field ( string $fieldName )
$fieldName string

filter() public method

Returns an array with only those elements that match the condition. The returned elements are in the original order.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/filter/
Since: 1.3
public filter ( mixed | self $input, mixed | self $as, mixed | self $cond )
$input mixed | self
$as mixed | self
$cond mixed | self

first() public method

Returns the value that results from applying an expression to the first document in a group of documents that share the same group by key. Only meaningful when documents are in a defined order.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/first/
public first ( mixed | self $expression )
$expression mixed | self

floor() public method

The expression can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/floor/
Since: 1.3
public floor ( mixed | self $number )
$number mixed | self

getExpression() public method

public getExpression ( ) : array
return array

gt() public method

false when the first value is less than or equivalent to the second value.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/gt/
public gt ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

gte() public method

false when the first value is less than the second value.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/gte/
public gte ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

hour() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/hour/
public hour ( mixed | self $expression )
$expression mixed | self

ifNull() public method

The arguments can be any valid expression.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/ifNull/
public ifNull ( mixed | self $expression, mixed | self $replacementExpression )
$expression mixed | self
$replacementExpression mixed | self

isArray() public method

The can be any valid expression.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/isArray/
Since: 1.3
public isArray ( mixed | self $expression )
$expression mixed | self

last() public method

Only meaningful when documents are in a defined order.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/last/
public last ( mixed | self $expression )
$expression mixed | self

let() public method

Binds variables for use in the specified expression, and returns the result of the expression.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/let/
public let ( mixed | self $vars, mixed | self $in )
$vars mixed | self Assignment block for the variables accessible in the in expression. To assign a variable, specify a string for the variable name and assign a valid expression for the value.
$in mixed | self The expression to evaluate.

literal() public method

Returns a value without parsing. Use for values that the aggregation pipeline may interpret as an expression.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/literal/
public literal ( mixed | self $value )
$value mixed | self

ln() public method

The expression can be any valid expression as long as it resolves to a non-negative number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/log/
Since: 1.3
public ln ( mixed | self $number )
$number mixed | self

log() public method

The expression can be any valid expression as long as it resolves to a non-negative number. The expression can be any valid expression as long as it resolves to a positive number greater than 1.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/log/
Since: 1.3
public log ( mixed | self $number, mixed | self $base )
$number mixed | self
$base mixed | self

log10() public method

The expression can be any valid expression as long as it resolves to a non-negative number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/log10/
Since: 1.3
public log10 ( mixed | self $number )
$number mixed | self

lt() public method

false when the first value is greater than or equivalent to the second value.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/lt/
public lt ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

lte() public method

false when the first value is greater than the second value.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/lte/
public lte ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

map() public method

Applies an expression to each item in an array and returns an array with the applied results.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/map/
public map ( mixed | self $input, string $as, mixed | self $in )
$input mixed | self An expression that resolves to an array.
$as string The variable name for the items in the input array. The in expression accesses each item in the input array by this variable.
$in mixed | self The expression to apply to each item in the input array. The expression accesses the item by its variable name.

max() public method

Returns the highest value that results from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/max/
public max ( mixed | self $expression )
$expression mixed | self

meta() public method

Returns the metadata associated with a document in a pipeline operations.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/meta/
public meta ( $metaDataKeyword )
$metaDataKeyword

millisecond() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/millisecond/
public millisecond ( mixed | self $expression )
$expression mixed | self

min() public method

Returns the lowest value that results from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/min/
public min ( mixed | self $expression )
$expression mixed | self

minute() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/minute/
public minute ( mixed | self $expression )
$expression mixed | self

mod() public method

The arguments can be any valid expression as long as they resolve to numbers.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/mod/
public mod ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

month() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/month/
public month ( mixed | self $expression )
$expression mixed | self

multiply() public method

The arguments can be any valid expression as long as they resolve to numbers.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/multiply/
public multiply ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

ne() public method

false when the values are equivalent.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/ne/
public ne ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

not() public method

Evaluates a boolean and returns the opposite boolean value.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/not/
public not ( mixed | self $expression )
$expression mixed | self

pow() public method

The expression can be any valid expression as long as it resolves to a non-negative number. The expression can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/pow/
Since: 1.3
public pow ( mixed | self $number, mixed | self $exponent )
$number mixed | self
$exponent mixed | self

push() public method

Returns an array of all values that result from applying an expression to each document in a group of documents that share the same group by key.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/push/
public push ( mixed | self $expression )
$expression mixed | self

second() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/second/
public second ( mixed | self $expression )
$expression mixed | self

setDifference() public method

The arguments can be any valid expression as long as they each resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/setDifference/
public setDifference ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

setEquals() public method

The arguments can be any valid expression as long as they each resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/setEquals/
public setEquals ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

setIntersection() public method

The arguments can be any valid expression as long as they each resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/setIntersection/
public setIntersection ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

setIsSubset() public method

The arguments can be any valid expression as long as they each resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/setIsSubset/
public setIsSubset ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

setUnion() public method

The arguments can be any valid expression as long as they each resolve to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/setUnion/
public setUnion ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

size() public method

The argument can be any expression as long as it resolves to an array.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/size/
public size ( mixed | self $expression )
$expression mixed | self

slice() public method

Returns a subset of an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/slice/
Since: 1.3
public slice ( mixed | self $array, mixed | self $n, mixed | self | null $position = null )
$array mixed | self
$n mixed | self
$position mixed | self | null

sqrt() public method

The argument can be any valid expression as long as it resolves to a non-negative number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/sqrt/
public sqrt ( mixed | self $expression )
$expression mixed | self

stdDevPop() public method

The arguments can be any expression as long as it resolves to an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/stdDevPop/
Since: 1.3
public stdDevPop ( mixed | self $expression1 )
$expression1 mixed | self

stdDevSamp() public method

The arguments can be any expression as long as it resolves to an array.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/stdDevSamp/
Since: 1.3
public stdDevSamp ( mixed | self $expression1 )
$expression1 mixed | self

strcasecmp() public method

0 if the two strings are equal. -1 if the first string is “less than” the second string. The arguments can be any valid expression as long as they resolve to strings.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/strcasecmp/
public strcasecmp ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

substr() public method

The arguments can be any valid expression as long as long as the first argument resolves to a string, and the second and third arguments resolve to integers.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/substr/
public substr ( mixed | self $string, mixed | self $start, mixed | self $length )
$string mixed | self
$start mixed | self
$length mixed | self

subtract() public method

The arguments can be any valid expression as long as they resolve to numbers and/or dates.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/subtract/
public subtract ( mixed | self $expression1, mixed | self $expression2 )
$expression1 mixed | self
$expression2 mixed | self

sum() public method

Calculates and returns the sum of all the numeric values that result from applying a specified expression to each document in a group of documents that share the same group by key. Ignores nun-numeric values.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/sum/
public sum ( mixed | self $expression )
$expression mixed | self

toLower() public method

The argument can be any expression as long as it resolves to a string.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/toLower/
public toLower ( mixed | self $expression )
$expression mixed | self

toUpper() public method

The argument can be any expression as long as it resolves to a string.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/toUpper/
public toUpper ( mixed | self $expression )
$expression mixed | self

trunc() public method

The expression can be any valid expression as long as it resolves to a number.
See also: https://docs.mongodb.org/manual/reference/operator/aggregation/trunc/
Since: 1.3
public trunc ( mixed | self $number )
$number mixed | self

week() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/week/
public week ( mixed | self $expression )
$expression mixed | self

year() public method

The argument can be any expression as long as it resolves to a date.
See also: http://docs.mongodb.org/manual/reference/operator/aggregation/year/
public year ( mixed | self $expression )
$expression mixed | self