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
110
110
111
111
Use the ``openUploadStream()`` method from ``GridFSBucket`` to create an upload
112
112
stream 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
114
114
``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:
118
119
119
120
.. code-block:: javascript
120
121
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