In MongoDB, the $cosh
aggregation pipeline operator returns the hyperbolic cosine of a value that is measured in radians.
$cosh
accepts any valid expression that resolves to a number.
The $cosh
operator was introduced in MongoDB 4.2.
In MongoDB, the $cosh
aggregation pipeline operator returns the hyperbolic cosine of a value that is measured in radians.
$cosh
accepts any valid expression that resolves to a number.
The $cosh
operator was introduced in MongoDB 4.2.
In MongoDB, the $asin
aggregation pipeline operator returns the arcsine (inverse sine) of a value, measured in radians.
$asin
accepts any valid expression that resolves to a number between -1
 and 1
.
The $asin
operator was introduced in MongoDB 4.2.
In MongoDB, the $divide
aggregation pipeline operator divides one number by another and returns the result.
To use $divide
, pass the numbers in an array. The $divide
operator will divide the first number by the second number. In other words, the first number is the dividend, and the second number is the divisor.
The arguments can be any valid expression as long as they resolve to numbers.
Continue readingIn MongoDB, the $multiply
aggregation pipeline operator multiplies numbers together and returns the result.
To use the $multiply
operator, pass the numbers to the operator in an array.
The arguments can be any valid expression, as long as they resolve to numbers.
Continue readingIn MongoDB, you can use the $subtract
aggregation pipeline operator to subtract numbers and/or dates.
In MongoDB, the $add
aggregation pipeline operator adds values together. Such values can be numbers, or they can be numbers and a date.
The $add
operator accepts the values as arguments. The arguments can be any valid expression as long as they resolve to either all numbers or to numbers and a date.
In MongoDB, the $anyElementTrue
aggregation pipeline operator evaluates an array as a set and returns true
if any of the elements are true
.
If none of the elements is true
, then it returns false
.
An array’s element is true
if it’s not false
, null
, 0
, or undefined
.
In MongoDB, the $allElementsTrue
aggregation pipeline operator evaluates an array as a set and returns true
if no element in the array is false
.
If the array contains an element that is false
, then $allElementsTrue
returns false
.
An array’s element is true
if it’s not false
, null
, 0
, or undefined
.
If you’ve used T-SQL you will probably be familiar with the GO
command. This command is often placed at the end of a batch of statements.
MongoDB has a $push
operator and an $addToSet
operator, both of which do a very similar thing.
Both operators append values to an existing array. The main difference is in how they deal with arrays that already contain the value you’re trying to append, and also in the modifiers that can be used.
Continue reading