Skip to content

Commit c603096

Browse files
committed
SERVER-6801 Document lack of character encoding support in $substr.
1 parent 59991ba commit c603096

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

source/reference/aggregation.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -732,10 +732,16 @@ These operators manipulate strings within projection expressions.
732732
.. expression:: $substr
733733

734734
:expression:`$substr` takes a string and two numbers. The first
735-
number represents the number of characters in the string to skip,
736-
and the second number specifies the number of characters to return
735+
number represents the number of bytes in the string to skip,
736+
and the second number specifies the number of bytes to return
737737
from the string.
738738

739+
.. note::
740+
741+
::expression:`$substr` is not encoding aware and if used
742+
improperly may produce a result string containing an invalid utf-8
743+
character sequence.
744+
739745
.. expression:: $toLower
740746

741747
Takes a single string and converts that string to lowercase,

0 commit comments

Comments
 (0)