File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ Overview
16
16
--------
17
17
18
18
In this guide, you can learn how to create BSON documents, read BSON from a file,
19
- and write BSON to a file using {+driver-short+}.
19
+ and write BSON to a file by using {+driver-short+}.
20
20
21
21
**BSON**, or Binary JSON, is the data format that MongoDB uses to organize
22
22
and store data. This data format includes all JSON data structure types and
@@ -43,7 +43,10 @@ Create a BSON Document
43
43
----------------------
44
44
45
45
You can create a BSON document by using the same notation you use to create a
46
- dictionary in {+language+}. The following example creates a BSON document that
46
+ dictionary in {+language+}. {+driver-short+} automatically converts {+language+} dictionaries
47
+ into BSON documents when inserting them into a collection.
48
+
49
+ The following example creates a BSON document that
47
50
represents the preceding sample BSON document:
48
51
49
52
.. code-block:: python
@@ -111,8 +114,8 @@ The following example reads the sample BSON document from ``file.bson``:
111
114
112
115
with open('file.bson', 'rb') as file:
113
116
data = file.read()
114
- doc = BSON(data).decode()
115
- print(doc )
117
+ document = BSON(data).decode()
118
+ print(document )
116
119
117
120
.. output::
118
121
:visible: false
You can’t perform that action at this time.
0 commit comments