From e8eaace7fd2961896e23e53a2f5abeb1aef00724 Mon Sep 17 00:00:00 2001 From: ianf-mongodb <85948430+ianf-mongodb@users.noreply.github.com> Date: Fri, 19 Jan 2024 15:13:28 -0500 Subject: [PATCH] DOCSP-23996 Add enableUtf8Validation Connectionstring Option (#576) * DOCSP-23996 Add enableUtf8Validation Connectionstring Option * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * Apply suggestions from code review Co-authored-by: Sarah Olson <98367156+sarah-olson-mongodb@users.noreply.github.com> * * --------- Co-authored-by: Sarah Olson <98367156+sarah-olson-mongodb@users.noreply.github.com> --- source/includes/fact-non-utf8-data.rst | 30 ++++++++++++++++++++++++++ source/query/filter.txt | 7 ++++++ 2 files changed, 37 insertions(+) create mode 100644 source/includes/fact-non-utf8-data.rst diff --git a/source/includes/fact-non-utf8-data.rst b/source/includes/fact-non-utf8-data.rst new file mode 100644 index 000000000..3f261d5db --- /dev/null +++ b/source/includes/fact-non-utf8-data.rst @@ -0,0 +1,30 @@ +If you attempt to query or export data with invalid UTF8 characters +the following error message displays: + +.. code-block:: none + :copyable: false + + Invalid UTF-8 string in BSON document. + +To query or export this data, disable UTF8 validation by setting +the ``enableUtf8Validation`` URI option to ``false``. + +.. warning:: + + **Editing data** with ``enableUtf8Validation=false`` can result in + loss of data. This approach is a temporary workaround to + query or export data only. + +The following URI disables UTF8 validation: + +.. code-block:: javascript + + mongodb://localhost:27017/?enableUtf8Validation=false + + +.. note:: + + You can also disable this option in the + :ref:`Advanced Connection Options ` by + selecting :guilabel:`enableUtf8Validation` and entering + ``false``. diff --git a/source/query/filter.txt b/source/query/filter.txt index d3f3da422..550386618 100644 --- a/source/query/filter.txt +++ b/source/query/filter.txt @@ -375,6 +375,13 @@ Clear the Query .. include:: /includes/clear-query.rst +.. _compass-query-invalid-utf8-data: + +Query Collections with Invalid UTF8 Data +---------------------------------------- + +.. include:: /includes/fact-non-utf8-data.rst + How Does the Compass Query Compare to MongoDB and SQL Queries? --------------------------------------------------------------