DocumentDB LogoDocumentDB
HomeGitHubDiscordDocsPackagesBlogs
Back to DocumentationMQL Documentation
Commands
Aggregation
Query And Write
Operators
Accumulators
Aggregation
Arithmetic Expression
$abs
$add
$ceil
$divide
$exp
$floor
$ln
$log
$log10
$multiply
$pow
$round
$sqrt
$subtract
$trunc
Array Expression
Array Query
Array Update
Bitwise
Bitwise Query
Bitwise Update
Comparison Query
Conditional Expression
Data Size
Date Expression
Element Query
Evaluation Query
Field Update
Geospatial
Literal Expression
Logical Query
Miscellaneous
Miscellaneous Query
Object Expression
Projection
Set Expression
Timestamp Expression
Variable Expression
Window Operators
Reference/Operators/Arithmetic Expression

MongoDB Query Language (MQL) Arithmetic Expression Operators

Arithmetic expression operators perform mathematical operations on numeric values.

$abs

The $abs operator returns the absolute value of a number.

$add

The $add operator returns the sum of two numbers or the sum of a date and numbers.

$ceil

The $ceil operator returns the smallest integer greater than or equal to the specified number.

$divide

The $divide operator divides two numbers and returns the quotient.

$exp

The $exp operator raises e to the specified exponent and returns the result

$floor

The $floor operator returns the largest integer less than or equal to the specified number

$ln

The $ln operator calculates the natural logarithm of the input

$log

The $log operator calculates the logarithm of a number in the specified base

$log10

The $log10 operator calculates the log of a specified number in base 10

$multiply

The $multiply operator multiplies the input numerical values

$pow

The `$pow` operator calculates the value of a numerical value raised to the power of a specified exponent.

$round

The $round operator rounds a number to a specified decimal place.

$sqrt

The $sqrt operator calculates and returns the square root of an input number

$subtract

The $subtract operator subtracts two numbers and returns the result.

$trunc

The $trunc operator truncates a number to a specified decimal place.

Copyright © DocumentDB a Series of LF Projects, LLC. For web site terms of use, trademark policy and other project policies please see https://lfprojects.org.