diff --git a/source/data-formats/extended-json.txt b/source/data-formats/extended-json.txt index 3d62ec4e..010910ff 100644 --- a/source/data-formats/extended-json.txt +++ b/source/data-formats/extended-json.txt @@ -28,7 +28,7 @@ Read Extended JSON ------------------ You can read an Extended JSON documents into a {+language+} object by using the -``BsonSerializer.Deserialize()`` method. The following example reads an +``BsonDocument.Parse()`` method. The following example reads an Extended JSON document into a ``BsonDocument`` object: .. io-code-block:: @@ -78,7 +78,7 @@ property: API Documentation ----------------- -To learn more about the methods and classes used on this page, see the following API +To learn more about the methods and classes you can use to work with JSON documents, see the following API documentation: - `BsonDocument <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.BsonDocument.html>`__ @@ -87,5 +87,4 @@ documentation: - `JsonWriter <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.IO.JsonWriter.html>`__ - `JsonReader <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.IO.JsonReader.html>`__ - `JsonWriterSettings <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.IO.JsonWriterSettings.html>`__ -- `JsonReaderSettings <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.IO.JsonReaderSettings.html>`__ - `JsonOutputMode <{+new-api-root+}/MongoDB.Bson/MongoDB.Bson.IO.JsonOutputMode.html>`__ \ No newline at end of file diff --git a/source/includes/fundamentals/code-examples/ExtendedJson.cs b/source/includes/fundamentals/code-examples/ExtendedJson.cs index 1f0f1a8e..7a24d794 100644 --- a/source/includes/fundamentals/code-examples/ExtendedJson.cs +++ b/source/includes/fundamentals/code-examples/ExtendedJson.cs @@ -1,6 +1,4 @@ using MongoDB.Bson; -using MongoDB.Bson.IO; -using MongoDB.Bson.Serialization; public class ExtendedJson { @@ -10,11 +8,11 @@ public static void Main(string[] args) // start-read-ejson var ejson = "{\n\"_id\": { \"$oid\": \"573a1391f29313caabcd9637\" },\n \"createdAt\": { \"$date\": { \"$numberLong\": \"1601499609\" }},\n\"numViews\": { \"$numberLong\": \"36520312\" }\n}\n\n"; - var document = BsonSerializer.Deserialize(ejson); + var document = BsonDocument.Parse(ejson); Console.WriteLine(document.ToJson()); // end-read-ejson } - + { // start-write-ejson var document = new MyDocument();