MongoDB $mod

In MongoDB, the $mod aggregation pipeline operator divides one number by another and returns the remainder.

To use $mod, pass the two numbers in an array. The $mod operator will divide the first number by the second number and return the remainder. 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.

Read more

MongoDB $strLenCP

MongoDB, the $strLenCP aggregation pipeline operator returns the number of UTF-8 code points in the specified string.

The $strLenCP operator is different to the $strLenBytes operator, which returns the number of bytes in the string.

Read more

MongoDB $strLenBytes

MongoDB, the $strLenBytes aggregation pipeline operator returns the number of UTF-8 encoded bytes in the specified string.

Each character in a string can contain contain a different number of bytes, depending on the character being used. The $strLenBytes operator can figure out how many bytes each character contains and return the correct result for the whole string.

Read more

MongoDB $stdDevPop

In MongoDB, the $stdDevPop aggregation pipeline operator calculates the population standard deviation of its input values. 

The input values can be from a group of documents (i.e. documents that are grouped by the same key), or they can be multiple fields within a single document.

Read more