In MongoDB, the $toLower aggregation pipeline operator converts a string to lowercase and returns the result.
convert
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.
Converting Between Date & Time Data Types in SQL Server (T-SQL Examples)
When you convert between date and time data types in SQL Server, you need to be mindful of how the new data type will handle the value you’re trying to assign to it.
In some cases you might lose part of the value, in other cases you might gain a bunch of zeros (increasing storage size in the process). You may also end up with a value that’s been rounded up.
The following articles contain examples of conversions between the different date and time data types, with a particular focus on the issues I just mentioned.