You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -14,26 +14,31 @@ Document Data Format: Extended JSON
14
14
Overview
15
15
--------
16
16
17
-
JSON is a data format that encodes the values of objects, arrays, numbers, and
18
-
so on. The **Extended JSON** format adds special syntax to JSON objects to
19
-
represent field type information that directly corresponds to each type in
20
-
BSON, the format that MongoDB uses to store data.
17
+
JSON is a data format that represents the values of objects, arrays, numbers,
18
+
strings, booleans, and nulls. The **Extended JSON** format defines a reserved
19
+
set of keys prefixed with "``$``" to represent field type information that
20
+
directly corresponds to each type in BSON, the format that MongoDB uses to
21
+
store data.
21
22
22
23
This guide explains the following topics:
23
24
24
25
- the different MongoDB Extended JSON formats
25
26
- how to use the BSON library to convert between Extended JSON and Java objects
27
+
- how to create a custom conversion of BSON types
26
28
27
29
For more information on the difference between these formats, see our
28
30
`article on JSON and BSON <https://www.mongodb.com/json-and-bson>`__.
29
31
30
32
Extended JSON Formats
31
33
---------------------
32
34
33
-
MongoDB Extended JSON represents BSON in different formats to handle
34
-
specific use cases. These formats differ in the level of prioritization in
35
-
preserving BSON type information and how closely they resemble ordinary,
36
-
human-readable JSON.
35
+
MongoDB Extended JSON features different string formats to represent BSON data.
36
+
Each of the different formats conform to the `JSON RFC <https://tools.ietf.org/html/rfc7159>`__
37
+
and meet specific use cases. The **extended** format, also known as the
38
+
**canonical** format, features specific representations for every BSON type
39
+
for bidirectional conversion without loss of information. The **relaxed**
40
+
format is more concise and closer to ordinary JSON, but does not represent
41
+
all the type information such as specific byte size of number fields.
37
42
38
43
See the table below to see a description of each format:
39
44
@@ -63,11 +68,10 @@ See the table below to see a description of each format:
63
68
|
64
69
| For more information on this format, see the server manual page on :manual:`Data Types in the mongo shell </core/shell-types/>`.
65
70
66
-
* - **Strict**
67
-
- | Deprecated. This representation is the legacy format that fully conforms to the `JSON RFC <http://www.json.org/>`__ which allows any JSON parser to read the type information.
68
-
| This format prioritizes for compatibility at the loss of certain type information introduced in newer versions of BSON.
69
-
|
70
-
| For more information on this format, see the server manual page on :manual:`Extended JSON (v1) </reference/mongodb-extended-json-v1/>`.
71
+
.. _extended_json_example_section:
72
+
73
+
For more detailed information on these formats, see the
0 commit comments