Skip to content

$toString

Converts a value to its string representation.

Syntax

{ "$toString": <expression> }

Example

Input

{ "orderId": 12345 }

Stage

{ "$project": { "orderId": { "$toString": "$orderId" } } }

Output

{ "orderId": "12345" }