File tree Expand file tree Collapse file tree 6 files changed +12
-11
lines changed Expand file tree Collapse file tree 6 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -110,11 +110,12 @@ Upload Files
110110
111111Use the ``openUploadStream()`` method from ``GridFSBucket`` to create an upload
112112stream for a given file name. You can use the ``pipe()`` method to
113- connect a Node.js ``fs`` read stream to the upload stream. The
113+ connect a Node.js read stream to the upload stream. The
114114``openUploadStream()`` method allows you to specify configuration information
115- such as file chunk size and other field/value pairs to store as metadata. Set
116- these options as parameters of ``openUploadStream()`` as shown in the
117- following code snippet:
115+ such as file chunk size and other field/value pairs to store as metadata.
116+
117+ The following example shows how to pipe a Node.js read stream, represented by the
118+ variable ``fs``, to the ``openUploadStream()`` method of a ``GridFSBucket`` instance:
118119
119120.. code-block:: javascript
120121
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
88 const aggDB = client . db ( "agg_tutorials_db" ) ;
99
1010 // start-collection
11- const personColl = await aggDB . collection ( "persons" ) ;
11+ const personColl = aggDB . collection ( "persons" ) ;
1212 // end-collection
1313
1414 // start-insert-persons
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
88 const aggDB = client . db ( "agg_tutorials_db" ) ;
99
1010 // start-coll
11- const ordersColl = await aggDB . collection ( "orders" ) ;
11+ const ordersColl = aggDB . collection ( "orders" ) ;
1212 // end-coll
1313
1414 // start-insert-orders
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ async function run() {
88 const aggDB = client . db ( "agg_tutorials_db" ) ;
99
1010 // start-colls
11- const productsColl = await aggDB . collection ( "products" ) ;
12- const ordersColl = await aggDB . collection ( "orders" ) ;
11+ const productsColl = aggDB . collection ( "products" ) ;
12+ const ordersColl = aggDB . collection ( "orders" ) ;
1313 // end-colls
1414
1515 // start-insert-products
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ async function run() {
88 const aggDB = client . db ( "agg_tutorials_db" ) ;
99
1010 // start-colls
11- const ordersColl = await aggDB . collection ( "orders" ) ;
12- const productsColl = await aggDB . collection ( "products" ) ;
11+ const ordersColl = aggDB . collection ( "orders" ) ;
12+ const productsColl = aggDB . collection ( "products" ) ;
1313 // end-colls
1414
1515 // start-insert-orders
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
88 const aggDB = client . db ( "agg_tutorials_db" ) ;
99
1010 // start-coll
11- const ordersColl = await aggDB . collection ( "orders" ) ;
11+ const ordersColl = aggDB . collection ( "orders" ) ;
1212 // end-coll
1313
1414 // start-insert-orders
You can’t perform that action at this time.
0 commit comments