File tree Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Expand file tree Collapse file tree 2 files changed +4
-24
lines changed Original file line number Diff line number Diff line change 107
107
);
108
108
// end-bulk-write
109
109
110
- // Creates a GridFS bucket or references an existing one
111
- // start-gridfs-bucket
112
- $ bucket = $ client ->selectDatabase ('<database name> ' )->selectGridFSBucket ();
113
- // end-gridfs-bucket
114
-
115
110
// Stores a file in a GridFS bucket and writes data to the file
116
111
// start-gridfs-upload
112
+ $ bucket = $ client ->selectDatabase ('<database name> ' )->selectGridFSBucket ();
117
113
$ stream = $ bucket ->openUploadStream ('<file name> ' );
118
114
fwrite ($ stream , '<data> ' );
119
115
fclose ($ stream );
Original file line number Diff line number Diff line change @@ -171,23 +171,8 @@ operation:
171
171
To learn more about the ``MongoDB\Collection::bulkWrite()`` method, see the
172
172
:ref:`Bulk Write <php-bulk-write>` guide.
173
173
174
- Create a GridFS Bucket
175
- ----------------------
176
-
177
- The following code shows how to create or reference a GridFS bucket, which
178
- you can write large files to:
179
-
180
- .. literalinclude:: /includes/usage-examples/write-code-examples.php
181
- :start-after: start-gridfs-bucket
182
- :end-before: end-gridfs-bucket
183
- :language: php
184
- :dedent:
185
-
186
- To learn more about the ``MongoDB\Database::selectGridFSBucket()`` method, see the
187
- :ref:`Store Large Files <php-gridfs>` guide.
188
-
189
- Store GridFS Files
190
- ------------------
174
+ Store Large Files
175
+ -----------------
191
176
192
177
The following code shows how to store files in a GridFS bucket by
193
178
creating an upload stream:
@@ -198,5 +183,4 @@ creating an upload stream:
198
183
:language: php
199
184
:dedent:
200
185
201
- To learn more about the ``MongoDB\GridFS\Bucket::openUploadStream()`` method, see the
202
- :ref:`Store Large Files <php-gridfs>` guide.
186
+ To learn more about GridFS, see the :ref:`Store Large Files <php-gridfs>` guide.
You can’t perform that action at this time.
0 commit comments