Skip to content

Commit 8b9ae5c

Browse files
authored
PHPORM-186 Review of GridFS docs (#2993)
1 parent 8bbc663 commit 8b9ae5c

File tree

1 file changed

+14
-12
lines changed

1 file changed

+14
-12
lines changed

docs/filesystems.txt

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ to use the ``gridfs`` driver in ``config/filesystems.php``:
4747
],
4848
],
4949

50-
You can configure the disk the following settings in ``config/filesystems.php``:
50+
You can configure the following settings in ``config/filesystems.php``:
5151

5252
.. list-table::
5353
:header-rows: 1
@@ -60,7 +60,7 @@ You can configure the disk the following settings in ``config/filesystems.php``:
6060
- **Required**. Specifies the filesystem driver to use. Must be ``gridfs`` for MongoDB.
6161

6262
* - ``connection``
63-
- The database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
63+
- Database connection used to store jobs. It must be a ``mongodb`` connection. The driver uses the default connection if a connection is not specified.
6464

6565
* - ``database``
6666
- Name of the MongoDB database for the GridFS bucket. The driver uses the database of the connection if a database is not specified.
@@ -71,7 +71,7 @@ You can configure the disk the following settings in ``config/filesystems.php``:
7171
* - ``prefix``
7272
- Specifies a prefix for the name of the files that are stored in the bucket. Using a distinct bucket is recommended
7373
in order to store the files in a different collection, instead of using a prefix.
74-
The prefix should not start with a leading slash ``/``.
74+
The prefix should not start with a leading slash (``/``).
7575

7676
* - ``read-only``
7777
- If ``true``, writing to the GridFS bucket is disabled. Write operations will return ``false`` or throw exceptions
@@ -106,9 +106,10 @@ In this case, the options ``connection`` and ``database`` are ignored:
106106
Usage
107107
-----
108108

109-
A benefit of using Laravel Filesystem is that it provides a common interface
110-
for all the supported file systems. You can use the ``gridfs`` disk in the same
111-
way as the ``local`` disk.
109+
Laravel Filesystem provides a common interface for all the supported file systems.
110+
You can use the ``gridfs`` disk in the same way as the ``local`` disk.
111+
112+
The following example writes a file to the ``gridfs`` disk, then reads the file:
112113

113114
.. code-block:: php
114115

@@ -127,9 +128,10 @@ in the Laravel documentation.
127128
Versioning
128129
----------
129130

130-
File names in GridFS are metadata in file documents, which are identified by
131-
unique ObjectIDs. If multiple documents share the same file name, they are
132-
considered "revisions" and further distinguished by creation timestamps.
131+
GridFS creates file documents for each uploaded file. These documents contain
132+
metadata, including the file name and a unique ObjectId. If multiple documents
133+
share the same file name, they are considered "revisions" and further
134+
distinguished by creation timestamps.
133135

134136
The Laravel MongoDB integration uses the GridFS Flysystem adapter. It interacts
135137
with file revisions in the following ways:
@@ -140,7 +142,7 @@ with file revisions in the following ways:
140142
- Deleting a file deletes all the revisions of this file name
141143

142144
The GridFS Adapter for Flysystem does not provide access to a specific revision
143-
of a filename. You must use the
145+
of a file name. You must use the
144146
`GridFS API <https://www.mongodb.com/docs/php-library/current/tutorial/gridfs/>`__
145147
if you need to work with revisions, as shown in the following code:
146148

@@ -155,5 +157,5 @@ if you need to work with revisions, as shown in the following code:
155157

156158
.. note::
157159

158-
If you use a prefix the Filesystem component, you will have to handle it
159-
by yourself when using the GridFS API directly.
160+
If you specify the ``prefix`` Filesystem setting, you will have to explicitly
161+
prepend the file names when using the GridFS API directly.

0 commit comments

Comments
 (0)