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. |
|