Skip to content

Commit 206c173

Browse files
committed
reword
1 parent eef12cf commit 206c173

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

source/includes/gridfs/gridfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
# start upload files
1212
with bucket.open_upload_stream(
13-
"my_file", chunk_size_bytes=4,
13+
"my_file", chunk_size_bytes=1048576,
1414
metadata={"contentType": "text/plain"}) as grid_in:
1515
grid_in.write("data to store")
1616
# end upload files

source/write/gridfs.txt

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,12 @@ constructor, as shown below:
104104
Upload Files
105105
------------
106106

107-
Use the ``open_upload_stream()`` method from the ``GridFSBucket`` class to upload
108-
a file to a GridFS bucket. Pass the following parameters to the ``open_upload_stream()``
109-
method:
110-
111-
- ``filename``: The name of the file you want to upload
112-
- ``chunk_size_bytes``: The number of bytes per chunk of this file (optional)
113-
- ``metadata``: The file metadata (optional)
114-
115-
The following code example uploads a file named ``"my_file"`` to a GridFS bucket:
107+
Use the ``open_upload_stream()`` method from the ``GridFSBucket`` class to
108+
create an upload stream for a given file name. The ``open_upload_stream()``
109+
method allows you to specify configuration information such as file chunk
110+
size and other field/value pairs to store as metadata. Set these options
111+
as parameters of ``open_upload_stream()``, as shown in the following code
112+
example:
116113

117114
.. literalinclude:: /includes/gridfs/gridfs.py
118115
:language: python
@@ -161,8 +158,8 @@ Download Files
161158
--------------
162159

163160
You can download files from your MongoDB database by using the
164-
``open_download_stream_by_name()`` method from the ``GridFSBucket``
165-
class.
161+
``open_download_stream_by_name()`` method from ``GridFSBucket`` to create a
162+
download stream.
166163

167164
The following example shows you how to download a file referenced
168165
by the file name, ``"my_file"``, and read its contents:

0 commit comments

Comments
 (0)