Articles → MONGODB → $Strlencp Aggregation Operator In Mongodb$Strlencp Aggregation Operator In MongodbIn this article, we will discuss the $strLenCP aggregation operator in MongoDB.Purpose Before we go to the definition, let us understand Unicode. Unicode is a universal character encoding standard that assigns a unique number, called a code point to each character.The $strLenCP aggregation operator counts the number of code points in a string.Example Consider the following collection: -To get the number of code points for firstname, we will use the following query: -db.Employees.aggregate([ { $project: { firstname: 1, nameLength: { $strLenCP: "$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, nameLength: { $strLenCP: "$firstname" } } } ])
Query/Feedback