From 0dd37de9a9f3fe96b1492b7d912380bfdebb1a5b Mon Sep 17 00:00:00 2001 From: Mike Woofter <108414937+mongoKart@users.noreply.github.com> Date: Wed, 5 Jun 2024 10:21:52 -0500 Subject: [PATCH] user feedback (#893) (cherry picked from commit b815a9c045213a60fa36a51823574c494283dadf) --- source/fundamentals/gridfs.txt | 9 +++++---- source/includes/aggregation/filtered-subset.js | 2 +- source/includes/aggregation/group-total.js | 2 +- source/includes/aggregation/multi-field-join.js | 4 ++-- source/includes/aggregation/one-to-one-join.js | 4 ++-- source/includes/aggregation/unpack-arrays.js | 2 +- 6 files changed, 12 insertions(+), 11 deletions(-) diff --git a/source/fundamentals/gridfs.txt b/source/fundamentals/gridfs.txt index 1d072fcce..0546496f8 100644 --- a/source/fundamentals/gridfs.txt +++ b/source/fundamentals/gridfs.txt @@ -103,11 +103,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