Skip to content

Commit b4e42b9

Browse files
author
Chris Cho
committed
update headings
1 parent f154afd commit b4e42b9

File tree

1 file changed

+18
-13
lines changed

1 file changed

+18
-13
lines changed

source/fundamentals/data-formats/document-data-format-extended-json.txt

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -119,11 +119,14 @@ corresponds to the format of the example you want to see:
119119
Read Extended JSON
120120
------------------
121121

122-
You can read an Extended JSON string into Java objects with the BSON library
123-
by calling the ``parse()`` static method from either the ``Document`` or
124-
``BsonDocument`` class, depending on which object type you need. This method
125-
parses the Extended JSON string in any of the formats and returns an instance
126-
of that class containing the data.
122+
Using the Document Classes
123+
~~~~~~~~~~~~~~~~~~~~~~~~~~
124+
125+
You can read an Extended JSON string into Java document objects by calling
126+
the ``parse()`` static method from either the ``Document`` or ``BsonDocument``
127+
class, depending on which object type you need. This method parses the Extended
128+
JSON string in any of the formats and returns an instance of that class
129+
containing the data.
127130

128131
The following example shows how you can use the ``Document`` class to read
129132
an example Extended JSON string into a ``Document`` object using the
@@ -147,8 +150,8 @@ The output of the code above resembles the following:
147150
For more information on the driver document classes, see our Fundamentals page
148151
on :doc:`Documents </fundamentals/data-formats/documents>`.
149152

150-
Read Extended JSON using the BSON Library
151-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153+
Using the BSON Library
154+
~~~~~~~~~~~~~~~~~~~~~~
152155

153156
You can also read an Extended JSON string into Java objects without using
154157
the MongoDB driver's document classes by using the
@@ -196,6 +199,9 @@ section, see the following API documentation:
196199
Write Extended JSON
197200
-------------------
198201

202+
Using the Document Classes
203+
~~~~~~~~~~~~~~~~~~~~~~~~~~
204+
199205
You can write an Extended JSON string from an instance of ``Document`` or
200206
``BsonDocument`` by calling the ``toJson()`` method, passing it an instance of
201207
``JsonWriterSettings`` to specify the Extended JSON format.
@@ -217,13 +223,12 @@ The output of this code example resembles the following:
217223

218224
{"_id": ObjectId("507f1f77bcf86cd799439011"), "myNumber": NumberLong(4794261)}
219225

220-
Write Extended JSON using the BSON Library
221-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
226+
Using the BSON Library
227+
~~~~~~~~~~~~~~~~~~~~~~
222228

223-
You can also read an Extended JSON string into Java objects without using
224-
the MongoDB driver's document classes by using the
225-
:java-docs:`JsonWriter </apidocs/bson/org/bson/json/JsonWriter.html>` class.
226-
To construct an instance of ``JsonWriter``, pass a subclass of a Java
229+
You can also read an Extended JSON string into Java objects using the BSON
230+
library directly with the :java-docs:`JsonWriter </apidocs/bson/org/bson/json/JsonWriter.html>`
231+
class. To construct an instance of ``JsonWriter``, pass a subclass of a Java
227232
``Writer`` to specify how you want to output the Extended JSON. You can
228233
optionally pass a :java-docs:`JsonWriterSettings </apidocs/bson/org/bson/json/JsonWriterSettings.html>`
229234
instance to specify options such as the Extended JSON format. By default, the

0 commit comments

Comments
 (0)