The following table contains a list of whitespace characters that MongoDB removes by default when using the $trim
, $ltrim
, and $rtrim
aggregation pipeline operators.
Unicode | Escape sequence | Description |
---|---|---|
U+0000 | ‘0’ | Null character |
U+0020 | ‘ ‘ | Space |
U+0009 | ‘t’ | Horizontal tab |
U+000A | ‘n’ | Line feed/new line |
U+000B | ‘v’ | Vertical tab |
U+000C | ‘f’ | Form feed |
U+000D | ‘r’ | Carriage return |
U+00A0 | Non-breaking space | |
U+1680 | Ogham space mark | |
U+2000 | En quad | |
U+2001 | Em quad | |
U+2002 | En space | |
U+2003 | Em space | |
U+2004 | Three-per-em space | |
U+2005 | Four-per-em space | |
U+2006 | Six-per-em space | |
U+2007 | Figure space | |
U+2008 | Punctuation space | |
U+2009 | Thin space | |
U+200A | Hair space |
The above characters are removed by default when using the $trim
, $ltrim
, and $rtrim
operators. However, you can alternatively use the chars
parameter to specify which characters to remove when using those operators.