Articles → MONGODB → $Toupper Aggregation Operator In Mongodb$Toupper Aggregation Operator In MongodbIn this article, we will discuss the $toUpper aggregation operator in MongoDB.Purpose The $toUpper operator in MongoDB is used within the aggregation framework to convert a string to uppercase.Example Consider the following example.We are required to convert the firstname to uppercase. So, the query would be: -db.Employees.aggregate([ { $project: { firstname: 1, upperFirstname: { $toUpper: "$firstname" } } } ])Output Posted By - Karan Gupta Posted On - Monday, June 3, 2024 Query/Feedback Your Email Id** Subject* Query/Feedback Characters remaining 250**
db.Employees.aggregate([ { $project: { firstname: 1, upperFirstname: { $toUpper: "$firstname" } } } ])
Query/Feedback