$ltrim

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

Reference group: String aggregation expressions

What it does

Removes specified characters from the beginning.

Syntax

{$ltrim: { input, chars? }}

Use case

Remove leading padding.

$ltrim: practical example
{ $project: { clean: { $ltrim: { input: "$rawCode" } } } }
💡 Explanation Removes specified characters from the beginning. When to use it Remove leading padding.
Key Takeaways
  • Removes specified characters from the beginning.
  • Typical use: Remove leading padding.