@@ -18,9 +18,9 @@ Overview
1818In this guide, you can learn how to store and retrieve large files in
1919MongoDB using the **GridFS** specification. GridFS splits large files
2020into chunks and stores each chunk as a separate document. When you query
21- GridFS for a file, the driver will reassemble the chunks as needed. The
21+ GridFS for a file, the driver assembles the chunks as needed. The
2222driver implementation of GridFS is an abstraction that manages the operations
23- and organization of the file storage.
23+ and organization of the file storage.
2424
2525Use GridFS if the size of your files exceeds the BSON document size limit of
262616 MB. GridFS is also useful for accessing files without loading the entire file
@@ -37,7 +37,7 @@ bucket contains the following collections:
3737- The ``chunks`` collection, which stores the binary file chunks.
3838- The ``files`` collection, which stores the file metadata.
3939
40- When you create a new GridFS bucket, the driver creates the preceding
40+ When you create a new GridFS bucket, the driver creates the preceding
4141collections. The default bucket name ``fs`` prefixes the collection names,
4242unless you specify a different bucket name. The driver creates the new GridFS
4343bucket during the first write operation.
@@ -98,15 +98,15 @@ call the ``NewBucket()`` method with a database parameter:
9898 reference to the bucket rather than instantiating a new one.
9999
100100By default, the new bucket is named ``fs``. To instantiate a bucket with a
101- custom name, call the ``SetName()`` method on a ``BucketOptions`` instance as
101+ custom name, call the ``SetName()`` method on a ``BucketOptions`` instance as
102102follows:
103103
104104.. code-block:: go
105105
106106 db := client.Database("myDB")
107107 opts := options.GridFSBucket().SetName("custom name")
108108 bucket, err := gridfs.NewBucket(db, opts)
109-
109+
110110 if err != nil {
111111 panic(err)
112112 }
@@ -122,7 +122,7 @@ You can upload a file into a GridFS bucket in one of the following ways:
122122- Use the ``OpenUploadStream()`` method, which writes to an output stream.
123123
124124For either upload process, you can specify configuration information on an instance
125- of ``UploadOptions``. For a full list of ``UploadOptions`` fields, visit the
125+ of ``UploadOptions``. For a full list of ``UploadOptions`` fields, visit the
126126`API documentation <{+api+}/mongo/options#UploadOptions>`__.
127127
128128Upload with an Input Stream
@@ -159,12 +159,8 @@ content to a GridFS bucket. It uses an ``opts`` parameter to set file metadata:
159159 :language: none
160160 :visible: false
161161
162- New file uploaded with ID 62e005408bc04f3816b8bcd2
163-
164- .. note::
162+ New file uploaded with ID 62e00...
165163
166- The driver uniquely generates each object ID number. The ID number outputted
167- will resemble the sample output but varies with each file and user.
168164
169165Upload with an Output Stream
170166````````````````````````````
@@ -208,7 +204,7 @@ only certain file documents.
208204
209205.. note::
210206
211- The ``Find()`` method requires a query filter as a parameter. To match all
207+ The ``Find()`` method requires a query filter as a parameter. To match all
212208 documents in the ``files`` collection, pass an empty query filter to ``Find()``.
213209
214210The following example retrieves the file name and length of documents in the
@@ -292,7 +288,7 @@ Rename Files
292288
293289You can update the name of a GridFS file in your bucket by using the ``Rename()``
294290method. Pass a file ID value and a new ``filename`` value as arguments to
295- ``Rename()``.
291+ ``Rename()``.
296292
297293The following example renames a file to ``"mongodbTutorial.zip"``:
298294
@@ -309,7 +305,7 @@ Delete Files
309305~~~~~~~~~~~~
310306
311307You can remove a file from your GridFS bucket by using the ``Delete()`` method.
312- Pass a file ID value as an argument to ``Delete()``.
308+ Pass a file ID value as an argument to ``Delete()``.
313309
314310The following example deletes a file:
315311
0 commit comments