Skip to content

$toDouble

Converts a value to a double-precision floating point number.

Syntax

{ "$toDouble": <expression> }

Example

Input

{ "price": "19.75" }

Stage

{ "$project": { "price": { "$toDouble": "$price" } } }

Output

{ "price": 19.75 }