添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
Docs Menu

$toString (aggregation)

$toString

Converts a value to a string. If the value cannot be converted to a string, $toString errors. If the value is null or missing, $toString returns null.

$toString has the following syntax:

{
$toString: <expression>
}

The $toString takes any valid expression .

The $toString is a shorthand for the following $convert expression:

{ $convert: { input: <expression>, to: "string" } }

The following table lists the input types that can be converted to a