Articles → MONGODB → $Strlencp Aggregation Operator In Mongodb
$Strlencp Aggregation Operator In Mongodb
Purpose
 
Example
 
db.Employees.aggregate([
    {
        $project: {
            firstname: 1,
            nameLength: { $strLenCP: "$firstname" }
        }
    }
])
Output
 
| Posted By  - | Karan Gupta | 
|  | 
| Posted On  - | Monday, June 3, 2024 |