$sinh is a MongoDB aggregation expression that returns the hyperbolic sine of a number: (ex − e−x) / 2. Inputs are treated as radians. Unlike $sin, the result is not limited to −1…1 and is not periodic.
for each document:
x = evaluate(expression)
if x is null or missing:
result = null
else if x is NaN:
result = NaN
else if x is ±Infinity:
result = ±Infinity
else:
result = (e^x - e^(-x)) / 2
emit { ..., field: result }
Reference
Cheat Sheet
Keep these facts handy while writing hyperbolic-sine expressions.
Topic
Detail
Type
Aggregation expression (not a find filter)
Syntax
{ $sinh: <expression> }
Formula
(ex − e−x) / 2
Units
Input treated as radians
Oddness
sinh(−x) = −sinh(x)
Key values
sinh(0)=0, sinh(1)≈1.175
vs $sin
Hyperbolic vs circular
Try it
Live Preview
Watch $sinh compute hyperbolic sine. Try common radian inputs.
Simulates $sinh (same idea as the mongosh examples below).
Result
x = 1
$sinh(x) → 1.175201
{ result: 1.175201 }
Trace
Worked Walkthrough — sinh(1)
Compute hyperbolic sine of 1 using the definition with e.
Then $sinh. Hyperbolic sine runs on the radian value → about 1.066.
Skip conversion only when the field is already in radians.
Edge Cases & Pitfalls
Check these before using $sinh in production pipelines.
units
Radians by default
Do not feed raw degrees into $sinh. Convert with $degreesToRadians first.
vs
Not the same as $sin
$sin is circular and bounded. $sinh grows quickly for large |x|.
null
Null and missing become null
Missing fields return null, not an error. Handle them before math if nulls are invalid.
range
Large |x| grows fast
Hyperbolic sine rises exponentially. Very large inputs can overflow toward ±Infinity.
Analysis
Performance Notes
Approach
Cost
Best for
$sinh alone
Per-document math
Values already in radians
+ $degreesToRadians
One extra conversion
Degree-stored angles
With other hyperbolics
Still O(docs)
sinh / cosh / tanh reports
Hyperbolic math is cheap compared with large sorts or joins. Filter early with $match when only some documents need $sinh.
Remember
Key Takeaways
Role: hyperbolic sine of x (radians).
Formula:(ex − e−x) / 2.
Odd:sinh(−x) = −sinh(x).
Degrees: convert with $degreesToRadians.
One line:$sinh answers “what is the hyperbolic sine of this radian value?”—like Math.sinh.
Frequently Asked Questions
$sinh returns the hyperbolic sine of a number. The formula is sinh(x) = (e^x − e^(−x)) / 2. Use it inside aggregation expression stages such as $project and $addFields. Inputs are treated as radians.
The syntax is { $sinh: <expression> }. The expression can be a field reference, a literal number, or nested numeric math.
$sin is circular trigonometry (periodic, output roughly −1 to 1). $sinh is hyperbolic: it grows exponentially and is not periodic. They solve different problems.
Yes. sinh(−x) = −sinh(x). Applying $sinh to a negative value returns the negated result of the positive value.
$sinh returns null when the input is null or the field is missing. NaN returns NaN. ±Infinity returns ±Infinity.
Convert degrees to radians first with $degreesToRadians, then pass that to $sinh: { $sinh: { $degreesToRadians: "$angle" } }.