AI 에이전트의 경우: 문서 인덱스는 https://www.mongodb.com/ko-kr/docs/llms.txt에서 사용할 수 있으며, 모든 페이지의 마크다운 버전은 어떤 URL 경로에 .md를 추가하여 사용할 수 있습니다.
Docs Menu

acosh (표현식 연산자)

$acosh

값의 역쌍곡선 코사인(쌍곡선 아크 코사인)을 반환합니다.

$acosh 의 구문은 다음과 같습니다:

{ $acosh: <expression> }

$acosh takes any valid expression that resolves to a number between 1 and +Infinity, e.g. 1 <= value <= +Infinity.

$acosh returns values in radians. Use $radiansToDegrees operator to convert the output value from radians to degrees.

By default $acosh returns values as a double. $acosh can also return values as a 128-bit decimal as long as the <expression> resolves to a 128-bit decimal value.

표현식에 대한 자세한 내용은 표현식을 참조하세요 .

If the argument resolves to a value of null or refers to a field that is missing, $acosh returns null. If the argument resolves to NaN, $acosh returns NaN. If the argument resolves to negative infinity, $acosh throws an error. If the argument resolves to Infinity, $acosh returns Infinity. If the argument resolves to a value outside the bounds of [-1, Infinity] inclusive, $acosh throws an error.

예시
결과

{ $acosh: NaN }

NaN

{ $acosh: null }

null

{ $acosh : Infinity}

Infinity

{ $acosh : 0 }

다음과 같은 형식의 출력과 유사한 오류 메시지를 표시합니다.

"errmsg" :
"Failed to optimize pipeline :: caused by :: cannot
apply $acosh to -inf, value must in (1,inf)"

trigonometry 컬렉션에는 2-D 그래프의 x 축을 따라 값을 저장하는 문서가 포함되어 있습니다.

{
"_id" : ObjectId("5c50782193f833234ba90d85"),
"x-coordinate" : Decimal128("3")
}

The following aggregation operation uses the $acosh expression to calculate inverse hyperbolic cosine of x-coordinate and add it to the input document using the $addFields pipeline stage.

db.trigonometry.aggregate([
{
$addFields : {
"y-coordinate" : {
$radiansToDegrees : { $acosh : "$x-coordinate" }
}
}
}
])

The $radiansToDegrees expression converts the radian value returned by $acosh to the equivalent value in degrees.

이 명령은 다음 출력을 반환합니다.

{
"_id" : ObjectId("5c50782193f833234ba90d85"),
"x-coordinate" : Decimal128("3"),
"y-coordinate" : Decimal128("100.9979734210524228844295260083432")
}

Since x-coordinate is stored as a 128-bit decimal, the output of $acosh is a 128-bit decimal.

이 페이지 평가하기

이 페이지의 내용