In MongoDB, the $toUpper aggregation pipeline operator converts a string to uppercase and returns the result.
convert
MongoDB $toLower
In MongoDB, the $toLower aggregation pipeline operator converts a string to lowercase and returns the result.
MongoDB $toObjectId
From MongoDB 4.0, you can use the $toObjectId aggregation pipeline operator to convert a string to an ObjectId.
The string must be a hexadecimal string of length 24.
MongoDB $toLong
From MongoDB 4.0, you can use the $toLong aggregation pipeline operator to convert a value to a long.
MongoDB $toInt
From MongoDB 4.0, you can use the $toInt aggregation pipeline operator to convert a value to an integer.
MongoDB $toDouble
From MongoDB 4.0, you can use the $toDouble aggregation pipeline operator to convert a value to a double.
MongoDB $toDecimal
From MongoDB 4.0, you can use the $toDecimal aggregation pipeline operator to convert a value to a decimal.
MongoDB $toBool
From MongoDB 4.0, you can use the $toBool aggregation pipeline operator to convert a value to a boolean.
MongoDB $toString
From MongoDB 4.0, you can use the $toString aggregation pipeline operator to convert a value to a string.
MongoDB $convert
In MongoDB, you can use the $convert aggregation pipeline operator to convert a value to a specified type.
You can convert any valid expression to a double, string, ObjectId, boolean, Date, integer, long, or decimal.