MongoDB Mathematical Properties and Functions
kodingwindow@kw:~$ mongosh
...
test> Math.PI
3.141592653589793

test> Math.E
2.718281828459045

test> Math.min(-4,3)
-4

test> Math.max(-4,3)
3

test> Math.abs(-2.3)
2.3

test> Math.round(-2.3)
-2

test> Math.floor(-2.3)
-3

test> Math.ceil(-2.3)
-2

test> Math.exp(0)
1

test> Math.pow(0,0)
1

test> Math.sqrt(25)
5

test> Math.cbrt(27)
3

test> Math.log(2)
0.6931471805599453

test> Math.log10(2)
0.3010299956639812

test> Math.sin(90)
0.8939966636005579

test> Math.cos(90)
-0.4480736161291701

test> Math.tan(90)
-1.995200412208242
Advertisement