Skip to content

Commit 061d067

Browse files
mungitoperritojeff-allen-mongo
authored andcommitted
DOCSP-17524-TOOLS docs repo adds matching warning
1 parent 94e914a commit 061d067

File tree

3 files changed

+24
-0
lines changed

3 files changed

+24
-0
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. warning:: Data Import and Export Conflicts With (``$``) and (``.``)
2+
3+
Starting in MongoDB 5.0, document field names can be (``$``)
4+
prefixed and can contain a (``.``). However,
5+
:binary:`~bin.mongoimport` and :binary:`~bin.mongoexport` should not
6+
be used with field names that make use of these characters.
7+
8+
:ref:`MongoDB Extended JSON v2 <extended-json-high-level-ref-v2>`
9+
cannot differentiate between type wrappers and fields that happen to
10+
have the same name as type wrappers. Do not use Extended JSON
11+
formats in contexts where the corresponding BSON representations
12+
might include (``$``) prefixed keys. The
13+
:ref:`DBRef <dbref-explanation>` mechanism is an exception to this
14+
general rule.
15+
16+
There are also restrictions on using :binary:`~bin.mongoimport` and
17+
:binary:`~bin.mongoexport` with (``.``) in field names. Since CSV
18+
files use the (``.``) to represent data hierarchies, a (``.``) in a
19+
field name will be misinterpreted as a level of nesting.
20+

source/mongoexport.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,8 @@ If you specify read preference in the URI string and the
302302
:option:`--readPreference <mongoexport --readPreference>` value
303303
overrides the read preference specified in the URI string.
304304

305+
.. include:: /includes/warning-tools-dot-dollar-import-export-restriction.rst
306+
305307
.. _mongoexport-options:
306308

307309
Options

source/mongoimport.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,8 @@ with the :option:`--auth <mongod.--auth>` option, you must use the
144144
possess, at a minimum, the :authrole:`readWrite` role on the database
145145
into which they are importing data.
146146

147+
.. include:: /includes/warning-tools-dot-dollar-import-export-restriction.rst
148+
147149
Options
148150
-------
149151

0 commit comments

Comments
 (0)