diff --git a/source/fundamentals/gridfs.txt b/source/fundamentals/gridfs.txt index e08527ad1..1b0f9db64 100644 --- a/source/fundamentals/gridfs.txt +++ b/source/fundamentals/gridfs.txt @@ -110,11 +110,12 @@ Upload Files Use the ``openUploadStream()`` method from ``GridFSBucket`` to create an upload stream for a given file name. You can use the ``pipe()`` method to -connect a Node.js ``fs`` read stream to the upload stream. The +connect a Node.js read stream to the upload stream. The ``openUploadStream()`` method allows you to specify configuration information -such as file chunk size and other field/value pairs to store as metadata. Set -these options as parameters of ``openUploadStream()`` as shown in the -following code snippet: +such as file chunk size and other field/value pairs to store as metadata. + +The following example shows how to pipe a Node.js read stream, represented by the +variable ``fs``, to the ``openUploadStream()`` method of a ``GridFSBucket`` instance: .. code-block:: javascript diff --git a/source/includes/aggregation/filtered-subset.js b/source/includes/aggregation/filtered-subset.js index 8671c9192..5f3f949f7 100644 --- a/source/includes/aggregation/filtered-subset.js +++ b/source/includes/aggregation/filtered-subset.js @@ -8,7 +8,7 @@ async function run() { const aggDB = client.db("agg_tutorials_db"); // start-collection - const personColl = await aggDB.collection("persons"); + const personColl = aggDB.collection("persons"); // end-collection // start-insert-persons diff --git a/source/includes/aggregation/group-total.js b/source/includes/aggregation/group-total.js index 73de1ad75..3d4780439 100644 --- a/source/includes/aggregation/group-total.js +++ b/source/includes/aggregation/group-total.js @@ -8,7 +8,7 @@ async function run() { const aggDB = client.db("agg_tutorials_db"); // start-coll - const ordersColl = await aggDB.collection("orders"); + const ordersColl = aggDB.collection("orders"); // end-coll // start-insert-orders diff --git a/source/includes/aggregation/multi-field-join.js b/source/includes/aggregation/multi-field-join.js index e84c36431..3cbb6fe83 100644 --- a/source/includes/aggregation/multi-field-join.js +++ b/source/includes/aggregation/multi-field-join.js @@ -8,8 +8,8 @@ async function run() { const aggDB = client.db("agg_tutorials_db"); // start-colls - const productsColl = await aggDB.collection("products"); - const ordersColl = await aggDB.collection("orders"); + const productsColl = aggDB.collection("products"); + const ordersColl = aggDB.collection("orders"); // end-colls // start-insert-products diff --git a/source/includes/aggregation/one-to-one-join.js b/source/includes/aggregation/one-to-one-join.js index c719798d7..0c08e5e31 100644 --- a/source/includes/aggregation/one-to-one-join.js +++ b/source/includes/aggregation/one-to-one-join.js @@ -8,8 +8,8 @@ async function run() { const aggDB = client.db("agg_tutorials_db"); // start-colls - const ordersColl = await aggDB.collection("orders"); - const productsColl = await aggDB.collection("products"); + const ordersColl = aggDB.collection("orders"); + const productsColl = aggDB.collection("products"); // end-colls // start-insert-orders diff --git a/source/includes/aggregation/unpack-arrays.js b/source/includes/aggregation/unpack-arrays.js index 16f26dbf8..d1f9ccbe3 100644 --- a/source/includes/aggregation/unpack-arrays.js +++ b/source/includes/aggregation/unpack-arrays.js @@ -8,7 +8,7 @@ async function run() { const aggDB = client.db("agg_tutorials_db"); // start-coll - const ordersColl = await aggDB.collection("orders"); + const ordersColl = aggDB.collection("orders"); // end-coll // start-insert-orders