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 @@ -103,11 +103,12 @@ Upload Files
103
103
104
104
Use the ``openUploadStream()`` method from ``GridFSBucket`` to create an upload
105
105
stream for a given file name. You can use the ``pipe()`` method to
106
- connect a Node.js ``fs`` read stream to the upload stream. The
106
+ connect a Node.js read stream to the upload stream. The
107
107
``openUploadStream()`` method allows you to specify configuration information
108
- such as file chunk size and other field/value pairs to store as metadata. Set
109
- these options as parameters of ``openUploadStream()`` as shown in the
110
- following code snippet:
108
+ such as file chunk size and other field/value pairs to store as metadata.
109
+
110
+ The following example shows how to pipe a Node.js read stream, represented by the
111
+ variable ``fs``, to the ``openUploadStream()`` method of a ``GridFSBucket`` instance:
111
112
112
113
.. code-block:: javascript
113
114
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
8
8
const aggDB = client . db ( "agg_tutorials_db" ) ;
9
9
10
10
// start-collection
11
- const personColl = await aggDB . collection ( "persons" ) ;
11
+ const personColl = aggDB . collection ( "persons" ) ;
12
12
// end-collection
13
13
14
14
// start-insert-persons
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
8
8
const aggDB = client . db ( "agg_tutorials_db" ) ;
9
9
10
10
// start-coll
11
- const ordersColl = await aggDB . collection ( "orders" ) ;
11
+ const ordersColl = aggDB . collection ( "orders" ) ;
12
12
// end-coll
13
13
14
14
// start-insert-orders
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ async function run() {
8
8
const aggDB = client . db ( "agg_tutorials_db" ) ;
9
9
10
10
// 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" ) ;
13
13
// end-colls
14
14
15
15
// start-insert-products
Original file line number Diff line number Diff line change @@ -8,8 +8,8 @@ async function run() {
8
8
const aggDB = client . db ( "agg_tutorials_db" ) ;
9
9
10
10
// 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" ) ;
13
13
// end-colls
14
14
15
15
// start-insert-orders
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ async function run() {
8
8
const aggDB = client . db ( "agg_tutorials_db" ) ;
9
9
10
10
// start-coll
11
- const ordersColl = await aggDB . collection ( "orders" ) ;
11
+ const ordersColl = aggDB . collection ( "orders" ) ;
12
12
// end-coll
13
13
14
14
// start-insert-orders
You can’t perform that action at this time.
0 commit comments