$strLenCP

Reference type:Cheat sheetFormat:Syntax + example + use case

Reference group: String aggregation expressions

What it does

Returns length measured in Unicode code points.

Syntax

{$strLenCP: string}

Use case

Validate human-readable character counts.

$strLenCP: practical example
{ $project: { characters: { $strLenCP: "$description" } } }
💡 Explanation Returns length measured in Unicode code points. When to use it Validate human-readable character counts.
Key Takeaways
  • Returns length measured in Unicode code points.
  • Typical use: Validate human-readable character counts.