Skip to content

Commit e4537ac

Browse files
authored
DOCSP-23996 Add enableUtf8Validation URI Option (#841)
* DOCSP-23996 Add enableUtf8Validation URI Option
1 parent 1510f35 commit e4537ac

File tree

1 file changed

+23
-1
lines changed

1 file changed

+23
-1
lines changed

source/fundamentals/connection/connection-options.txt

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ parameters of the connection URI to specify the behavior of the client.
1717

1818
.. list-table::
1919
:header-rows: 1
20-
:widths: 1 1 1 1
20+
:widths: 30 20 10 40
2121

2222
* - Name
2323
- Accepted Values
@@ -73,6 +73,28 @@ parameters of the connection URI to specify the behavior of the client.
7373
- Specifies whether to force dispatch **all** operations to the host
7474
specified in the connection URI.
7575

76+
* - **enableUtf8Validation**
77+
- boolean
78+
- ``true``
79+
-
80+
Specifying ``true`` enables UTF-8 validation for the
81+
connection. MongoDB throws an error when
82+
it attempts to serialize string data that contains invalid
83+
UTF-8 characters to BSON. This applies to both document keys and
84+
document values, this validation adds processing overhead.
85+
86+
Specifying ``false`` disables UTF-8 validation for the
87+
connection. MongoDB does not throw errors when
88+
data contains invalid UTF-8 data. If you disable validation,
89+
your application avoids the validation processing overhead.
90+
**Editing data** while validation is disabled
91+
can result in loss of data. Disabling UTF-8 validation is a
92+
temporary workaround to query or export data only.
93+
94+
You can also set UTF-8 validation in your :ref:`Node.js code
95+
<nodejs-utf-8-validation>`. To learn more about UTF-8 characters,
96+
see `UTF-8 <https://en.wikipedia.org/wiki/UTF-8>`__ on Wikipedia.
97+
7698
* - **heartbeatFrequencyMS**
7799
- integer greater than or equal to 500
78100
- ``null``

0 commit comments

Comments
 (0)